Commit eac72e4f by BellCodeEditor

save project

parent 51e70ca3
Showing with 9 additions and 6 deletions
...@@ -6,9 +6,12 @@ q=["石头","剪刀","布"] ...@@ -6,9 +6,12 @@ q=["石头","剪刀","布"]
a=random.choice(q) a=random.choice(q)
print("计算机出拳:"+a) print("计算机出拳:"+a)
if f==a: if f==q:
print("平局") if f==a:
elif f=="石头"and a=="剪刀" or f=="剪刀" and a=="布" or f=="布" and a=="石头": print("平局")
print("胜利") elif f=="石头"and a=="剪刀" or f=="剪刀" and a=="布" or f=="布" and a=="石头":
esle: print("胜利!")
print("失败") else:
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