Commit ea5b9e4a by BellCodeEditor

save project

parent 23dfff73
Showing with 19 additions and 0 deletions
import random
list=["石头","剪刀","布"]
while True:
player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player)
com=random.choice(list)
print("计算机出拳:"+com)
if player==com:
print("平局")
elif (player=="石头" and com=="布") or (player=="剪刀" and com=="石头") or (player=="布" and com=="剪刀"):
print("You lose!")
elif (com=="石头" and player=="布") or (com=="剪刀" and player=="石头") or (com=="布" and player=="剪刀"):
print("You win!")
elif player=="鸡":
print("axb")
break
else:
print("Your input was wrong!")
\ No newline at end of file
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