+ 12
I don't understand what the problem in this code
can someone help me, and take a look at my code? https://code.sololearn.com/c6PPmjd8BWI2/?ref=app
6 odpowiedzi
+ 9
import random
attack = ["rock", "paper", "scissors"]
blow = input("choose your blow: ")
print(blow)
x = random.choice(attack)
print("the computer choose:" + x)
if (blow == "rock"):
if x == "rock":
print("draw, you have lucky day")
elif x == "paper":
print("you lose the game, try again.")
elif x == "scissors":
print("you won the game! are you ready to lose?")
elif blow == "paper":
if x == "paper":
print("draw, so sad")
elif x == "rock":
print("you won!! 1-0 for you")
elif x == "scissors":
print ("you lose! I won, yahoo! 0.0")
elif blow == "scissors":
if x == "scissors":
print("draw, next time you win, ha?")
elif x == "paper":
print("yoh won...Your chance of winning is 0.3333333333 ")
elif x == "rock":
print("you lose, don't give up! fight to win")
print("like this game? +1")
print("I would be happy to receive constructive comments, or whatever you want")
+ 7
Raj Chhatrala good morning, thank you!
+ 6
this code will work perfectly
- 1
hgch
- 2
hey