Ask coding questions

← Back to all posts
Trying to practice using loops, so I made a janken game.
Gillus

Janken, is Japanese for rock paper scissors.
I am confuse on what I did wrong.

Answered by MrVoo [earned 5 cycles]
View Answer
Voters
Gillus
Comments
hotnewtop
MrVoo

It doesn't loop because you did your conditional wrong. While you may read line 32 as if both of these are under five, run my code., Python reads this as if playerScore is True, and ai_score is under 5, loop. The score of 0 represents false, so the program stops.

Add another < 5 before the and

Gillus

@MrVoo That explains a lot thank you! Your a life saver man, I was going insane.