Commit 9aaf53e4 by BellCodeEditor

save project

parent 2c11c2f3
Showing with 8 additions and 5 deletions
import random import random
player=input("请出拳:拳/剪/布")# 玩家出拳 p=input("请出拳:拳/剪/布")# 玩家出拳
print("玩家出拳:"+player) print("玩家出拳:"+p)
f=["拳","剪","布"] f=["拳","剪","布"]
q=random.choice(f) q=random.choice(f)
print(q) print(q)
if f==q: if (p != "拳") or (p != "剪") or (p != "布"):
print("请重输")
elif p==q:
print("平局") print("平局")
elif (f=="拳" and q=="剪") or (f=="剪" and q=="布") or (f=="布" and q=="拳"): elif (p=="拳" and q=="剪") or (p=="剪" and q=="布") or (p=="布" and q=="拳"):
print("赢") 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