Commit b17afb47 by BellCodeEditor

save project

parent 4c6e98bf
Showing with 5 additions and 3 deletions
s = input ("玩家出拳" (石头/剪刀/) s = input ("玩家出拳(石头/剪刀/布)")
print("玩家出拳"+ s) print("玩家出拳"+ s)
import random import random
lao = ["石头","剪刀","布"] lao = ["石头","剪刀","布"]
com= random.choice(lao) com= random.choice(lao)
print("计算机出拳"+com) print("计算机出拳"+com)
if s==com if s in lao:
if s==com:
print("平局") print("平局")
elif s=="石头" and com=="剪刀" or s=="布" and "石头" or s=="剪刀" and com=="布": elif s=="石头" and com=="剪刀" or s=="布" and "石头" or s=="剪刀" and com=="布":
print("你赢了") print("你赢了")
else: else:
print("你输了") 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