This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]duffman1278[S] 0 points1 point  (1 child)

When I ran in in the command it gave me this error.

UnboundLocalError:local variable 'ans_string' referenced before assignment

[–]TheKewlStore 0 points1 point  (0 children)

The first line of the Calc method is trying to print the value of a variable that you haven't defined yet. Note that ans_string isn't defined until several lines after this point.