Commit c824638b by BellCodeEditor

save project

parent a21b4faa
Showing with 14 additions and 9 deletions
k=input("请玩家出拳(石头/剪刀/布)") k=input("请玩家出拳(石头/剪刀/布)")
print("玩家出拳:"+k) print("玩家出拳:"+k)
...@@ -6,14 +7,17 @@ list=["石头","剪刀","布"] ...@@ -6,14 +7,17 @@ list=["石头","剪刀","布"]
a=random.choice(list) a=random.choice(list)
print("电脑出拳:"+a) print("电脑出拳:"+a)
if k==a: if k in list:
print("平局") if k==a:
elif k=="石头" and a=="剪刀": print("平局")
print("恭喜,你赢了!") elif k=="石头" and a=="剪刀":
elif k=="剪刀" and a=="布": print("恭喜,你赢了!")
print("恭喜,你赢了!") elif k=="剪刀" and a=="布":
elif k=="布" and a=="石头": print("恭喜,你赢了!")
print("恭喜,你赢了!") elif k=="布" and a=="石头":
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