Commit 918014ed by BellCodeEditor

save project

parent 56255beb
Showing with 8 additions and 5 deletions
...@@ -6,13 +6,16 @@ list=["剪刀","石头","布"] ...@@ -6,13 +6,16 @@ list=["剪刀","石头","布"]
d=random.choice(list) d=random.choice(list)
print("机器出",d) print("机器出",d)
print("玩家出",s) print("玩家出",s)
if s=d: if s in list:
if s=d:
print("平局") print("平局")
elif s=="石头" and d=="剪刀": elif s=="石头" and d=="剪刀":
print("玩家赢") print("玩家赢")
elif s=="石头" and d=="剪刀": elif s=="石头" and d=="剪刀":
print("玩家赢") print("玩家赢")
elif s=="剪刀" and d=="布": elif s=="剪刀" and d=="布":
print("玩家赢") print("玩家赢")
else: else:
print("机器赢") 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