Commit 45ad9ab8 by BellCodeEditor

save project

parent 0e616ea6
Showing with 2 additions and 1 deletions
...@@ -4,7 +4,8 @@ import random#调用随机函数 ...@@ -4,7 +4,8 @@ import random#调用随机函数
com=["石头","剪刀","布"]#列表赋值 com=["石头","剪刀","布"]#列表赋值
sss=random.choice(com)#让人机随机输入 sss=random.choice(com)#让人机随机输入
print("人机出了"+sss)#输出人机的输入 print("人机出了"+sss)#输出人机的输入
if sb in com:#判断是否输入错误 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=="石头") :#判断玩家是否输了
......
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