Variable Scope
x = 10 # Global\ndef func():\n y = 20 # Local\n print(x, y)\n\ndef increment():\n global count\n count += 1Modules
A module is a .py file with Python code.
import math\nprint(math.pi) # 3.14159\nprint(math.sqrt(16)) # 4.0\n\nimport random\nprint(random.randint(1, 10))Common ModulesModuleUsemathMath functionsrandomRandom numbersosOS operationsdatetimeDate/timesysSystem