Commit ecd93d8b by BellCodeEditor

save project

parent bf1c0dcf
Showing with 26 additions and 0 deletions
import random
while True:
list = ["剪刀","石头","布"]
player = input("玩家出拳(剪刀/石头/布)")
print("玩家出拳:"+ player)
comp = random.choice(list)
print("电脑出拳:"+ comp)
if player in list:
print("输入正确")
if player == comp:
print("平局")
elif player=="石头" and comp=="剪刀" or player=="布" and comp=="石头" or player=="剪刀" and comp=="布":
print("玩家获胜")
else:
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