0
Can't get out of the while loop!(SOLVED)
Im making a rock paper scissors game. At the end of the game it is supposed to ask the player if he wants to play again: (y/n) and the programme should keep asking the player if he gives anything else as input (other than 'y' and 'n'). Now my problem is that i keep typing y to play again but it keeps asking me without stopping. https://code.sololearn.com/cT9p5EZ7p7Ir/?ref=app
3 Answers
+ 5
1. The first variable assignment should be
x = 'y'
2. Change your second "while" loop to
while x!='y' and x!='n':
+ 1
Damn Diego beat me to it
You change it to "and" because in "or" if the first condition is true it won't even check for the other condition
+ 1
On my original programm i had x='y' but the problem was that with the and.
Thank you guys!