Commit 41665894 by BellCodeEditor

save project

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