Commit b24f2cd2 by BellCodeEditor

save project

parent 29aaf432
Showing with 16 additions and 11 deletions
import random import random
t = input("玩家请出拳(石头/剪刀/布):") t = input("玩家请出拳(石头/剪刀/布):")
print("玩家了:"+t) print("玩家了:"+t)
list = ["石头","剪刀","布"] list = ["石头","剪刀","布"]
y = random.choice(list) y = random.choice(list)
print("电脑出了:"+y) print("伏特加出来:"+y)
if t==y: if t in list:
print("平局") print("输入正确")
elif t=="石头" and y=="剪刀": if t==y:
print("赢了") print("平局")
elif t=="布" and y=="石头": elif t=="石头" and y=="剪刀":
print("赢了") print("赢了")
elif t=="剪刀" and y=="布": elif t=="布" and y=="石头":
print("赢了") print("赢了")
elif t=="剪刀" and y=="布":
print("赢了")
else:
print("输了")
else: else:
print("输了") print("??????")
\ 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