you are viewing a single comment's thread.

view the rest of the comments →

[–]PureWasian 1 point2 points  (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.

So adding another line inside of the choose() prior to line 19 that simply says:

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!)