Commit 1cd5e27e by BellCodeEditor

save project

parent e17d66c0
Showing with 14 additions and 5 deletions
import random# 玩家出拳 import random# 玩家出拳
player=input("请玩家出拳(拳头/剪刀/布):") a=input("请玩家出拳(拳头/剪刀/布):")
print("玩家出:"+player) print("玩家出:"+a)
list=["拳头","剪刀","布"] list=["拳头","剪刀","布"]
computer=random.choice(list) b=random.choice(list)
print("电脑出:"+computer) print("电脑出:"+b)
\ No newline at end of file
if a==b:
print("平局")
elif (a=="剪刀" and b=="布") or (a=="布" and b=="拳头") or (a=="拳头" and b=="剪刀"):
print("玩家赢")
else:
print("电脑赢")
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