Global variable is python
'''l=10#global
def fun1():
#l=5#local
m=8#local
#it through error beacuse not have permision if it change so take global keyword
global l
l=l+45
print(l)
fun1()
'''
x=90
def deep():
x=20
def rohan():
global x
x = 88
print("before calling rohan()",x)
rohan()
print("after calling rohan()",x)
deep()
print(x)
Comments
Post a Comment