Example
The global Keyword
The global keyword allows modifying a global variable inside a function.
5 results
Example
The global keyword allows modifying a global variable inside a function.
Quiz
…quiz on Python variable scope: 15 questions on local and global variables, the global and nonlocal keywords, and nested functions.
Quiz
…int() and dynamic typing Constants by convention and the global keyword How it works 15 questions: 11 with one correct answer, 4 where you select every correct answer After each question you see the…
Article Python Fundamentals
…way of knowing which slot a single argument was meant for. Keyword arguments Remember the swapped "Mars" and 4? Keyword arguments solve that. Instead of relying on position, you name the parameter…
Article Python Fundamentals
…are different variables) Cannot use Python's reserved keywords Reserved Keywords in Python Python reserves certain words for its own use. You cannot use these as variable names: # Common reserved…