Variable in Python
Variable in Python
Assignment operator
Age = 20
Types:
def fun():
local_var=10
• Local Variable
• A variable declared inside a function is a local variable.
• It is only accessible within that function.
Code:
Output :
• Global Variable
• A variable declared outside of any function or block is a global
variable.
• It is accessible throughout the entire program.
Code:
Output :