Commit 14ee1e8a by BellCodeEditor

save project

parent e99520f3
Showing with 6 additions and 1 deletions
...@@ -5,7 +5,9 @@ import random ...@@ -5,7 +5,9 @@ import random
list=("石"+"剪"+"布") list=("石"+"剪"+"布")
computer=random.choice(list) computer=random.choice(list)
print("计算机出拳:"+computer) print("计算机出拳:"+computer)
if player==computer: if player in list :
print("输入正确!")
if player == computer:
print("平局") print("平局")
elif player=="石头" and computer=="剪": elif player=="石头" and computer=="剪":
print("你胜利了!") print("你胜利了!")
...@@ -13,8 +15,11 @@ elif player=="布" and computer=="石": ...@@ -13,8 +15,11 @@ elif player=="布" and computer=="石":
print("你胜利了!") print("你胜利了!")
elif player=="剪刀" and computer=="布": elif player=="剪刀" and computer=="布":
print("你胜利了!") print("你胜利了!")
else
else: else:
print("你失败了") 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