Commit b016c22b by BellCodeEditor

save project

parent a8c813be
Showing with 11 additions and 8 deletions
...@@ -2,15 +2,18 @@ import random ...@@ -2,15 +2,18 @@ import random
list=("石头","剪刀","布") list=("石头","剪刀","布")
A=input("请出拳(石头/剪刀/布):") A=input("请出拳(石头/剪刀/布):")
SD=random.choice(list) SD=random.choice(list)
print("玩家出:"+A) if A in list:
print("电脑出:"+SD) print("玩家出:"+A)
if A==SD: print("电脑出:"+SD)
print("平局") if A==SD:
elif (A=="石头" and SD=="布") or (A=="剪刀" and SD=="石头") or (A=="布" and SD=="剪刀"): print("平局")
print("你输了") elif (A=="石头" and SD=="布") or (A=="剪刀" and SD=="石头") or (A=="布" and SD=="剪刀"):
else: print("你输了")
print("你赢了") else:
print("你赢了")
else: 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