0
global a # Let global variable be a
a = None

def test():
   a = 2 #Assigned the value 2
   print(a) #The result of this is 2 (Which I desire)

def test2:
  print(a) #The result is None (But I expect it to be 2)
# Please Help me with this
khelwood
  • 55,782
  • 14
  • 81
  • 108

0 Answers0