
module 4 fns stk queue Python Programming Quiz
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Vigneshwari S
FREE Resource
Enhance your content in a minute
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a global variable in Python?
Defined inside a function
Defined outside all functions
Defined only in __main__
Must be declared using global
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed? x = 10 def show(): x = 5 print(x) show() print(x)
5 and 5
10 and 10
5 and 10
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to modify a global variable inside a function?
nonlocal
this
global
public
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which scope rule does Python follow for name resolution?
LIFO
LEGB
FIFO
OOP
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a variable is declared inside a function without global, it is:
Local
Global
Class variable
Static
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output? x = 100 def f(): global x x = 50 f() print(x)
100
50
Error
None
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does nonlocal keyword do?
Declares variable global
Declares variable local
Refers to enclosing function variable
Deletes a variable
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
50 questions
AKT test (1-50) Жаңа вариант
Quiz
•
University
46 questions
TIN HOC LƠP 4 HK1
Quiz
•
1st Grade - University
45 questions
Speech Recognition: Mid Test Preparation
Quiz
•
University
55 questions
3 курс Cybersecurity Compliance Framework & System Administratio
Quiz
•
University
50 questions
Midterm Examination-Advacomt (I-AINS) Asuncion
Quiz
•
University
55 questions
Final Examination: Fundamentals of Mixed Signals and Sensors
Quiz
•
University
45 questions
STACK DATA STRUCTURE
Quiz
•
University
50 questions
AKT test (251-300) Жаңа вариант
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
