Commit 51014f9f by BellCodeEditor

save project

parent 10fe5f84
Showing with 9 additions and 6 deletions
...@@ -5,9 +5,12 @@ import random ...@@ -5,9 +5,12 @@ import random
list=["剪刀","布","石头"] list=["剪刀","布","石头"]
h=random.choice(list) h=random.choice(list)
print(h) print(h)
if hh==h: if hh in list:
print("平局") if hh==h:
elif(hh=="石头" and h=="剪刀")or(hh=="剪刀" and h=="布")or(hh=="布" and h=="石头"): print("平局")
print("你赢了") elif(hh=="石头" and h=="剪刀")or(hh=="剪刀" and h=="布")or(hh=="布" and h=="石头"):
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