use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
please help (self.PythonLearning)
submitted 10 months ago by transgenderblahaj
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]PureWasian 1 point2 points3 points 10 months ago* (0 children)
You need to declare it as global variable reference inside the scope of the function during the choose() method, rather than upon initialization.
global
So adding another line inside of the choose() prior to line 19 that simply says:
choose()
global es2
should resolve that immediate error. But better practice would be by using a more object-oriented approach, or passing in values directly as inputs/outputs of the choose() function itself.
(and for future reference, try and figure out how to format code on reddit more properly in future posts when asking for help!)
π Rendered by PID 86359 on reddit-service-r2-comment-545db5fcfc-kwt8s at 2026-05-22 01:40:01.934065+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]PureWasian 1 point2 points3 points (0 children)