Hi, hope you're doing good.Could someone please tell me why does the while loop not stop when I type in rock, paper or scissors?
Here's the code: while True: choices = ["rock", "paper", "scissors"] user_choice = input("What is your choice, rock,paper or scissors: ") if not user_choice == choices or choices or choices: print("Please enter rock, paper or scissors! ")
This should be the code: while True: choices = ["rock", "paper", "scissors"] user_choice = input("What is your choice, rock,paper or scissors: ") if user_choice not in choices: print("Please enter rock, paper or scissors! ")
Ohh yesss thank you so much
Yes Lochard thank you for adding that but I already knew it I just wanted to know about the specific part I asked for as Yusuf said. Thanks to you guys y'all are awesome
The loop still doesn't break. Maybe you want somethin like this? https://code.sololearn.com/cvqS2ZFQ0i9n/?ref=app
Lochard he never asked for it to break, he asked for the loop to work. it was best if he figured the rest out himself
He asked why the while loop does not stop when he types in one of the choices in the title. So I guess that's what he wants. You are right about letting him figure out though. I guess I just wanted to practice coding.
How do I generate a list with <N> unique elements randomly selected from another (already existing) list?
Given three integer matrices A(m*n),B(m*n) and C(m*n) . Print the one with more zero elements. beside code
I'm coding this for hours & can't make the value of the 5 random numbers round off to 2 decimal places like in the examples
Overloading + operator
( NEED HELP ) Halloween candy