Commit 5d77e408 by BellCodeEditor

auto save

parent c0b5d117
Showing with 18 additions and 0 deletions
a=input("你要出什么?")
print("玩家出拳:"+a)
import random #导入模块
list=["石头","剪刀","布"] #创建列表
p=random.choice(list) #随机选择
print(p) #输出结果
if a in list:
if p==a:
print("平局")
elif (a=="石头" and p=="剪刀" ) or (a=="剪刀" and p=="布") or (a=="布" and p=="石头"):
print("你赢")
else:
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