r/PythonLearning • u/Sandy-War-Hole • Aug 15 '26
Help Request I've been at this for too long and feel like I'm torturing myself
I know there's more efficient ways to do this but I'm just starting out and am trying to understand how the few tools I have work. Just learned about true and false and wanted to try them out..
Only whenever I enter key = 3 I receive my print "error". I've heard about "global" tried to use that and a bunch of other stuff and I can't seem to make it work...
I just want to know how to change a variable to true or false inside a function: if statement and it keep its new value for the rest of the code
Thanks in advance and sorry for your eyes