Commit b9eddc26 by BellCodeEditor

save project

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