Commit 4ea24489 by BellCodeEditor

save project

parent 17de0f64
Showing with 8 additions and 5 deletions
...@@ -5,13 +5,16 @@ import random ...@@ -5,13 +5,16 @@ import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
awa=random.choice(list) awa=random.choice(list)
print(awa) print(awa)
if s==awa: if s in list:
if s==awa:
print("平局") print("平局")
elif s=="石头"and awa=="剪刀": elif s=="石头"and awa=="剪刀":
print("玩家胜") print("玩家胜")
elif s=="剪刀"and awa=="布": elif s=="剪刀"and awa=="布":
print("玩家胜") print("玩家胜")
elif s=="布"and awa=="石头": elif s=="布"and awa=="石头":
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