+ 2
Help me debug this
I was coding that but I dont know where I do mistake. Here is my code: import random wply="You won the game!" wpc="Computer won the game!" go="Game Over" lc=[rock, paper, scissors] ply=input("What will you choose? ") pc=random.choice(lc) if ply==pc: print("Draw") if ply==rock && pc== scissors: print(wply) if ply==paper && pc==rock: print(wply) if ply==scissors && pc==paper print(wply) else print(wpc)
7 Answers
+ 3
Thx! I fixed the and one!
+ 3
Ok so I'm uploading the code as 'Rock, paper, scissors!'! Hope you like it!
+ 2
Omg i forgot to place game over
+ 2
Python uses the "and" keyword instead of "&&". For example:
if ply == rock and pc == scissors:
print(wply)
Also rock, paper, and scissors are going to give you an error because they're not defined. You need to either define then as variables or wrap them in quotes.
+ 2
ikr i forgot : but now fixed, check Rock, Paper, Scissors!
+ 1
also you forgot write ':' after if
+ 1
colon,
python uses "and" instead of &&