a = 5
def foo():
if 1 == 2:
a = 10
print('a=', a)
if __name__ == '__main__':
foo()
Item 1: Unbound Local Error
Posted by Logan Chien
a = 5
def foo():
if 1 == 2:
a = 10
print('a=', a)
if __name__ == '__main__':
foo()