local variable, global variable in python
amitmund
June 03, 2026
x = "Hello"
def myfunc():
print("Python is " + x)
myfunc()
x = "Hello"
def myfunc():
x = "CTTC"
print("Python is " + x)
myfunc()
print("Python is " + x)