Commit 8ff2e72d by BellCodeEditor

save project

parent 7908d9d3
Showing with 8 additions and 5 deletions
...@@ -3,11 +3,14 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳 ...@@ -3,11 +3,14 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player) print("玩家出拳:"+player)
computer=["石头","剪刀","布"] computer=["石头","剪刀","布"]
print("计算机出拳:"+random.choice(computer)) print("计算机出拳:"+random.choice(computer))
if player==computer: if player in computer:
print("啦啦啦,平局!") if player==computer:
elif player=="拳头"and computer=="剪刀" or player=="布"and computer=="石头" or player=="剪刀"and computer=="布": print("啦啦啦,平局!")
print("赢了!") elif player=="拳头"and computer=="剪刀" or player=="布"and computer=="石头" or player=="剪刀"and computer=="布":
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