Apr-11-2018, 04:44 AM
Having a problem I can't understand. I can print one global string but not another.
#Playfair ENDE LETTERS = 'ABCDEFGHIKLMNOPQRSTUVWXYZ' MESSAGE = '''Oh, I see you ate one too!''' def main(): print (LETTERS) print (MESSAGE) MESSAGE = '''Oh no I didn't''' print (MESSAGE) if __name__ == '__main__': main()When I run it I get :
Error:ABCDEFGHIKLMNOPQRSTUVWXYZ
Traceback (most recent call last):
File "C:\Users\jarrod0987\AppData\Local\Programs\Python\Python36-32\Stub.py", line 16, in <module>
main()
File "C:\Users\jarrod0987\AppData\Local\Programs\Python\Python36-32\Stub.py", line 8, in main
print (MESSAGE)
UnboundLocalError: local variable 'MESSAGE' referenced before assignment
Why does LETTERS print but MESSAGE not print?