Commit a5f29615 by BellCodeEditor

save project

parent aa1e3457
Showing with 15 additions and 3 deletions
import random
s=["石头","剪刀","布"]
player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player)
c=random.choice("请出拳:石头/剪刀/布")# 玩家出拳
print("计算机出拳:"+c)
\ No newline at end of file
c=random.choice(s)# 玩家出拳
print("计算机出拳:"+c)
if player==c:
print("平局")
elif player=="石头"and c=="布":
print("玩家赢了")
elif player=="布"and c=="石头":
print("玩家赢了")
elif player=="剪刀"and c=="布":
print("玩家赢了")
else:
print("计算机赢了")
\ 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