Commit b9eddc26 by BellCodeEditor

save project

parent b4d665fa
Showing with 14 additions and 11 deletions
import random
# 玩家出拳
player=input("请玩家出拳:(石头/剪刀/布)")
print("玩家出拳:"+player)
list=["石头","剪刀","布"]
player=input("your turn:(rock/scissors/paper)")
print("player turn :"+player)
list=["rock","scissors","paper"]
computer=random.choice(list)
print("电脑出拳:"+computer)
if player==computer
print("draw")
elif(player=="石头" and computer=="剪刀") or (player=="剪刀" and computer=="布") or (player=="布" and computer=="石头")
print("congratulations,you win!")
elseprint("unfortunately,you lose!")
\ No newline at end of file
print("computer turn:"+computer)
if player in list:
if player==computer:
print("DRAW")
elif(player=="rock" and computer=="scissors") or (player=="scissors" and computer=="paper") or (player=="paper" and computer=="rock"):
print("congratulations,you WIN!")
else:
print("unfortunately,you LOSE!")
else:
print("ERROR")
\ 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