Repository navigation
Releases: gvzgithub/pylearn
Release list
atm1.0.0
1.0.6
1.0.5
This time the problem was successfully solved: the local variable 'invalid_choice_msg' might be referenced before assignment.
This time, I defined all the required variables outside the function and then assigned them inside the function.
In this version, I define all the required variables outside the function and set them to empty strings. Then, inside the main() function, we use the global keyword to declare these variables as global variables so that they can be assigned values inside the function.
Now, no matter which language the user chooses, the corresponding variables will be correctly assigned and there will be no "local variable may be referenced before assignment" errors.
1.0.4
In version 1.0.3, the invalid_choice_msg variable was defined in the if and elif statement blocks, but not in the else statement block. This resulted in an UnboundLocalError error.
In the new code, I moved the definition of the invalid_choice_msg variable before the if statement so that it would theoretically be defined correctly regardless of the user's language choice.
But there is still an error: (