Commit 5c6cd380 by BellCodeEditor

save project

parent 238e4a41
Showing with 11 additions and 7 deletions
# 玩家出拳
list=["rock","paper","scissors"]
name=input("what is your name?")
import random
player=input("rock/paper/scissors? ")
print(name+" is"+player)
list=["rock","paper","scissors"]
computer=random.choice(list)
print("computer is"+computer)
if player==computer:
if player in list:
print(name+" is "+player)
computer=random.choice(list)
print("computer is "+computer)
if player==computer:
print("draw")
elif (player=="rock" and computer=="paper") or (player=="paper" and computer=="scissors") or (player=="scissors" and computer=="rock"):
elif (player=="rock" and computer=="paper") or (player=="paper" and computer=="scissors") or (player=="scissors" and computer=="rock"):
print("computer,win")
else:
else:
print(name+",win")
else:
print("error,input it again")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment