Commit c3856c69 by BellCodeEditor

save project

parent b4863bd9
Showing with 4 additions and 3 deletions
...@@ -18,12 +18,13 @@ a=input("请出拳剪刀或石头或布:") ...@@ -18,12 +18,13 @@ a=input("请出拳剪刀或石头或布:")
b=random.choice(list) b=random.choice(list)
print("玩家出拳:",a) print("玩家出拳:",a)
print("电脑出拳",b) print("电脑出拳",b)
while True: if a in list:
if a==b: if a==b:
print("平局") print("平局")
elif a=="剪刀" and b=="布" or a=="布" and b=="石头" or a=="石头" and b=="剪刀" : elif (a=="剪刀" and b=="布") or (a=="布" and b=="石头") or (a=="石头" and b=="剪刀") :
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