Commit 9da5fa3e by BellCodeEditor

save project

parent 5ddae914
Showing with 6 additions and 3 deletions
...@@ -7,9 +7,12 @@ list=["石头","剪刀","布"] ...@@ -7,9 +7,12 @@ list=["石头","剪刀","布"]
lettle=random.choice(list) lettle=random.choice(list)
print("计算机出拳"+lettle) print("计算机出拳"+lettle)
#显示结果 #显示结果
if player==lettle: if player in list:
if player==lettle:
print("平局") print("平局")
elif (player=="石头" and lettle=="剪刀") or (player=="剪刀" and lettle=="布") or (player=="布" and lettle=="布"): elif (player=="石头" and lettle=="剪刀") or (player=="剪刀" and lettle=="布") or (player=="布" and lettle=="布"):
print("恭喜,你赢了") print("恭喜,你赢了")
else: else:
print("抱歉") 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