Jan-27-2020, 10:06 AM
(Jan-27-2020, 08:53 AM)ThiefOfTime Wrote: @perfringo actually it is not only the comparison of the while-loop causing the error, but the conversion to int.
Yes, you are correct and I made a mistake.
To catch more typing/error variations ('STOP', 'STop', etc) it is usually good to lower input.
input('Number: ').lower()With Python 3.8 one can take advantage of walrus operator (no need to assign answer outside the loop):
while (answer := input('Number: ').lower()) != 'stop': # do stuff
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.