Commit 3646116d by BellCodeEditor

save project

parent a014c590
Showing with 9 additions and 5 deletions
...@@ -4,9 +4,12 @@ import random ...@@ -4,9 +4,12 @@ import random
list=["剪刀","石头","布"] list=["剪刀","石头","布"]
letter=random.choice(list) letter=random.choice(list)
print("计算机出拳:"+letter) print("计算机出拳:"+letter)
if player==random: if player in list :
print("平局") if player==letter:
elif ("剪刀"==letter and player=="石头") or ("石头"==letter and player=="布") or ("布"==letter and player=="剪刀"): print("平局")
print("恭喜您,赢了!") elif ("剪刀"==letter and player=="石头") or ("石头"==letter and player=="布") or ("布"==letter and player=="剪刀"):
print("恭喜您,赢了!")
else:
print("很遗憾,您输了!")
else: else:
print("很遗憾,您输了!") 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