Commit 087671ee by BellCodeEditor

save project

parent 39ac5c63
Showing with 8 additions and 7 deletions
...@@ -4,10 +4,12 @@ print("玩家出:"+t) ...@@ -4,10 +4,12 @@ print("玩家出:"+t)
O=["石头","剪刀","布"] O=["石头","剪刀","布"]
d=random.choice(O) d=random.choice(O)
print("计算机出:"+d) print("计算机出:"+d)
if t in O:
if t==d: if t==d:
print("平局") print("平局")
elif t=="石头" and d=="剪刀" or t=="剪刀" and d=="布" or t=="布" and d=="石头": elif t=="石头" and d=="剪刀" or t=="剪刀" and d=="布" or t=="布" and d=="石头":
print("胜利") 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