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

30th Oct 2019, 1:38 PM
Ergo 42
Ergo 42 - avatar
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':
30th Oct 2019, 1:46 PM
Diego
Diego - avatar
+ 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
30th Oct 2019, 1:55 PM
Odyel
Odyel - avatar
+ 1
On my original programm i had x='y' but the problem was that with the and. Thank you guys!
30th Oct 2019, 2:05 PM
Ergo 42
Ergo 42 - avatar