Commit 3461ffba by BellCodeEditor

save project

parent 52c3c505
Showing with 8 additions and 6 deletions
...@@ -6,10 +6,12 @@ list = ["石头","剪刀","布"] ...@@ -6,10 +6,12 @@ list = ["石头","剪刀","布"]
a = random.choice(list) a = random.choice(list)
print("电脑出拳:"+a) print("电脑出拳:"+a)
if play == a: if play in list:
print("平局") if play == a:
if play=="石头" and a=="剪刀" or play=="剪刀" and a=="布" or play=="布" and a=="石头": print("平局")
print("恭喜你赢了") if play=="石头" and a=="剪刀" or play=="剪刀" and a=="布" or play=="布" and a=="石头":
print("恭喜你赢了")
else:
print("很遗憾,你输了")
else: else:
print("很遗憾,你输了") 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