Commit 2d1d6216 by BellCodeEditor

save project

parent be4264f4
Showing with 13 additions and 3 deletions
t=input("请出拳(石头/剪刀/布)") t=input("请出拳(石头/剪刀/布)")
...@@ -3,4 +3,14 @@ print("玩家出拳:"+t) ...@@ -3,4 +3,14 @@ print("玩家出拳:"+t)
import random import random
a=["石头","剪刀","布"] a=["石头","剪刀","布"]
computer=random.choice(a) computer=random.choice(a)
print("计算机出的是:"+computer) print("计算机出的是:"+computer)
\ No newline at end of file if t==computer:
print("平局")
elif t=="石头"and computer=="剪刀":
print("哈哈哈哈哈,你赢了!")
elif t=="布"and computer=="石头":
print("哈哈哈哈哈,你赢了!")
elif t=="剪刀"and computer=="布":
print("哈哈哈哈哈,你赢了!")
else:
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