
LEC Short Quiz # 2

Quiz
•
Other
•
University
•
Easy
Dindo Cerado
Used 8+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a global variable in Python?
A variable set inside a function
A variable declared outside all functions
A variable removed after function ends
A variable used only in one function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to a local variable after the function ends?
It stays accessible to all
It is removed and not reused
It turns into a global variable
It is kept for later access
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword allows you to change a global variable from inside a function?
local
global
lambda
function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What best describes a lambda function in Python?
A function with more than one line
A tiny anonymous one-line function
A function that sets global values
A regular function using lambda
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following shows the lambda function syntax?
lambda args: output
def name(args): output
function(args): result
lambda output: args
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is a lambda function different from a normal function?
Lambda allows multiple lines
Named functions are anonymous
Lambda is one-line and unnamed
Regular functions can't use input
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why are functions used in Python?
To increase code length
To simplify and reuse code
To make code more complex
To store global variables
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Class Test For Cloud Computing Skill Course

Quiz
•
University
25 questions
GE6/HUM3

Quiz
•
University
33 questions
Backend Postassessment Pratyaksh Athani

Quiz
•
University
32 questions
CO321 Embedded Systems Interrupts 2

Quiz
•
University
26 questions
Python Quiz SE 27/10/2023

Quiz
•
University
26 questions
python programming quiz

Quiz
•
12th Grade - University
29 questions
Sistemas de Identificación Humana

Quiz
•
University
25 questions
EXAM MMI

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Other
15 questions
Disney Trivia

Quiz
•
University
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University
20 questions
Disney Trivia

Quiz
•
University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
5 questions
Examining Theme

Interactive video
•
4th Grade - University
23 questions
Lab 4: Quizziz Questions

Quiz
•
University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University