Ask coding questions

← Back to all posts
Infinite loop bug no matter the answer
Axroxx (0)

On line 5 and 6, i have a while loop that in case the answer is something except for yes or no, that is supposed to make you re-write your answer. However, no matter the answer, it will allways repeat the while loop, even if you were to write yes or no.

Commentshotnewtop
vedprad1 (815)

In Line 5, you have to change or to and. Think logically. If the answer is yes or no, then the results will be one false, one true, which will always return true with or.

Simply put: change it to and.

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

P. S. You actually do not need parentheses for while or if statements.