Commit e66cfa73 by BellCodeEditor

auto save

parent 3abb6cd1
Showing with 16 additions and 2 deletions
p=input("玩家猜拳 石头剪刀布:")# 引号里面可以不写
print("玩家出:"+p)
\ No newline at end of file
print("玩家出:"+p)
import random
d=['石头','剪刀','布']
if p in d:
d=random.choice(d)
print("电脑出:"+d)
#我们出拳的结果:p 电脑出拳的结果是:d
if p==d:
print("平局")
elif p=="剪刀" and d=="布" or p=="石头" and d=="剪刀" or p=="布" and d=="剪刀":
print("玩家赢了")
else:
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