Commit 2a320a4e by BellCodeEditor

auto save

parent 3183d6b2
Showing with 8 additions and 7 deletions
import random
player=input("玩家出拳:")
print("玩家出拳:"+player)
h=["剪刀","石头","布"]
computer=random.choice(h)
print("计算机出拳"+computer)
if player in h:
while True:
player=input("玩家出拳:")
print("玩家出拳:"+player)
h=["剪刀","石头","布"]
computer=random.choice(h)
print("计算机出拳"+computer)
if player in h:
if player==computer:
print("平局")
elif player=="石头"and computer=="剪刀":
......@@ -15,5 +16,5 @@ if player in h:
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