why is it showing namechoice as undefined
so basically i'm making this thing, and when i try to use namechoice in firstStretch(), it just keeps on saying that namechoice is undefined. I have tried making namechoice global both in and out of the function, and other things, but it is not working. any suggestions?
global is for accessing variables while the code is in a function. You have to do it the other way around.
basically, here is an example:
This doesnt work
global foo foo = "bar" def baz(): print(foo)
foo = "bar" def baz(): global foo # this tells python that foo is outside of the function print(foo)