Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is a global variable?
Think about where it can be accessed from.
In which scenario can you access a local variable?
Consider the visibility of variables.
What is a local variable?
Where do you see local variables in your code?
The global keyword is used to:
Think of variable access rules.
Create a program that utilizes both global and nonlocal variables. Explain how changes to these variables affect function outputs.
Consider how each variable interacts within its scope.
Describe a scenario where using global variables could lead to debugging issues in a large codebase.
Think about function interactions and data flow.
5 more questions in this section. Enroll free to practise them all.
Enroll free