Commit 58edc172 by BellCodeEditor

save project

parent 2dced917
Showing with 18 additions and 7 deletions
# 玩家出拳 # 玩家出拳
import random while True:
see=input("请出拳(石头/剪刀/布):") import random
print("玩家出拳:"+see) see=input("请出拳(石头/剪刀/布):")
list=["石头","剪刀","布"] print("玩家出拳:"+see)
t=random.choice(list) list=["石头","剪刀","布"]
print("计算机出拳:"+t) t=random.choice(list)
\ No newline at end of file print("计算机出拳:"+t)
if see==t:
print("平局")
elif see=="石头" and t=="剪刀":
print("玩家赢")
elif see=="剪刀" and t=="布":
print("玩家赢")
elif see=="布" and t=="石头":
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