Review Note

Last Update: 07/10/2024 01:20 PM

Current Deck: Python fundamentals

Published

Currently Published Content


Code
def out():
global x
x = 5

out()
print(x)


Output
Explanation
You can use global to create global variables inside a function, unlike nonlocal.
Context
Python

Current Tags:

python_fundamentals

Pending Suggestions


No pending suggestions for this note.