
The Complete Python Course - Global Keyword: Change the Value of a Global Variable
Interactive Video
•
Information Technology (IT), Architecture
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Read more
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the global keyword in Python?
To delete a variable
To create a new variable
To modify a global variable
To declare a variable as local
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best describes the scope of a global variable?
It is only accessible within the file it is declared
It can be accessed from anywhere in the code
It can only be accessed within the function it is declared
It is only accessible within a class
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the example provided, what is the initial value assigned to the global variable?
15
5
0
10
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to the global variable's value after the function is called in the example?
It is updated to a new value
It is deleted
It remains unchanged
It is reset to its initial value
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the final value of the global variable after running the program?
15
10
5
0
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?