Commit feccb1ce by BellCodeEditor

save project

parent d22a4812
Showing with 11 additions and 4 deletions
......@@ -2,7 +2,14 @@ import random
qqk=input("请出拳(石头/剪刀/布):")
print("玩家出拳:"+qqk)
yyds=["石头","剪刀","布"]
print("电脑出拳:"+random.choice(yyds))
if qqk==yyds:
nbkls=random.choice(yyds)
print("电脑出拳:"+nbkls)
if qqk in yyds:
if qqk==nbkls:
print("平局")
elif qqk=="" and yyds=="" or
\ No newline at end of file
elif (qqk=="石头" and nbkls=="剪刀")or(qqk=="剪刀" and nbkls=="布")or(qqk=="布" and nbkls=="石头"):
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