Feb-10-2019, 08:19 PM
char.lower()
returns the text of char in lower case. This allows you to test against 'q' and 'Q' with one test. This gets past this problem:while char != 'Q' or 'q':which is a misuse of the 'or' operator. It is equivalent to:
while (char != 'Q') or 'q':Since non-empty strings evaluate as True, 'q' is always True and the loop condition is always True.
Also, break can't be used outside of a loop, that's why it was working for you.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures