Commit 2d1d6216 by BellCodeEditor

save project

parent be4264f4
Showing with 12 additions and 1 deletions
t=input("请出拳(石头/剪刀/布)") t=input("请出拳(石头/剪刀/布)")
...@@ -4,3 +4,13 @@ import random ...@@ -4,3 +4,13 @@ import random
a=["石头","剪刀","布"] a=["石头","剪刀","布"]
computer=random.choice(a) computer=random.choice(a)
print("计算机出的是:"+computer) print("计算机出的是:"+computer)
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