Scope of Variables num = 20 # Global variablesdef test1(): global num num = 10 # Local variables return num# def test2():# return num# print(test2())print(num)print(test1())print(num)
Post a Comment