Commit 0e616ea6 by BellCodeEditor

save project

parent 80472840
Showing with 15 additions and 13 deletions
sb=input("出什么?") sb=input("出什么?")#询问玩家输入的内容
print("你出"+sb) print("你出"+sb)#输出玩家输入的内容
import random#调用随机函数
import random com=["石头","剪刀","布"]#列表赋值
com=["石头","剪刀","布"] sss=random.choice(com)#让人机随机输入
sss=random.choice(com) print("人机出了"+sss)#输出人机的输入
print("人机出了"+sss) if sb in com:#判断是否输入错误
if sb==sss: if sb==sss:#判断是否平局
print("平局,奥利给") print("平局,奥利给")
elif (sss=="石头" and sb=="剪刀") or (sss=="剪刀"and sb=="布") or (sss=="布" and sb=="石头") : elif (sss=="石头" and sb=="剪刀") or (sss=="剪刀"and sb=="布") or (sss=="布" and sb=="石头") :#判断玩家是否输了
print("你输了,雪————花———飘—飘") print("你输了,雪————花———飘—飘")
else:#判断玩家是否赢了
print("妈妈,我咗的啦")
else: else:
print("妈妈,我咗的啦") print("大憨憨!输错了!你上过九年义务教育吗?")
\ No newline at end of file \ 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