Commit 81ee3499 by BellCodeEditor

save project

parent c26ec6d0
Showing with 10 additions and 7 deletions
...@@ -5,10 +5,14 @@ print("你出了:"+p) ...@@ -5,10 +5,14 @@ print("你出了:"+p)
import random import random
w=["石头","剪刀","布"] w=["石头","剪刀","布"]
q=random.choice(w) q=random.choice(w)
print("计算机出了:"+q) if p in w:
if p==q: print("计算机出了:"+q)
print("平局") if p==q:
elif (p=="剪刀" and q=="布") or (p=="布" and q=="石头") or (p=="石头" and q=="剪刀"): print("平局")
print("你赢了")
elif (p=="剪刀" and q=="布") or (p=="布" and q=="石头") or (p=="石头" and q=="剪刀"):
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