+ 1
I found this code from one member and I can not understand why it does not work.
6 Answers
+ 5
The code works fine, but the else block will never be reached, since the while loop will loop will loop until the user input 0 or 1 (or if incorrect type of input will error).
+ 1
That is, if I want to get 1 or 0 from the user, I can not organize the loop like this? Or is the problem in the interpreter here?
+ 1
Thanks to both of you. I understand the potential infinity of the loop, the problem was I did not understand if the code would cause an error in all shell's(what if it is usual python behavior). Now it's clear that the problem is in the local interpreter, and if I run it in IDLE, for example, it will work as it should, right?