Commit acf67f5e by BellCodeEditor

auto save

parent 25abb509
Showing with 21 additions and 3 deletions
player=input("请出拳:石头/剪刀/布")# 玩家出拳 import random # 调用random
print("玩家出拳:"+player)
\ No newline at end of file player=input("请出拳:石头/剪刀/布:")# 玩家出拳
print("玩家出拳:"+player)
list = ["石头","剪刀","布"] #计算机出拳
listter = random.choice(list)
print("计算机出拳:" + listter)
if player == listter: # 判断结果如何
print("这局是平局")
elif player == "石头" and listter == "剪刀":
print("这局玩家胜出")
elif player == "剪刀" and listter == "布":
print("这局玩家胜出")
elif player == "布" and listter == "石头":
print("这局玩家胜出")
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