Commit 27c2578f by BellCodeEditor

save project

parent 1369d9aa
Showing with 17 additions and 4 deletions
import random
a=input("请出拳:(石头,剪刀,布:)")
print("玩家出拳"+a)
a=input("请出拳:(石头,剪刀,布):")
print("玩家出拳:"+a)
abg=["石头","剪刀","布"]
ab=random.choice(abg)
print("计算机出拳"+ab)
\ No newline at end of file
print("计算机出拳:"+ab)
if a==ab:
print("平局")
elif a=="石头" and ab=="剪刀":
print("恭喜你,你赢了")
elif a=="石头" and ab=="布":
print("很遗憾,你输了")
elif a=="剪刀" and ab=="布":
print("恭喜你,你赢了")
elif a=="剪刀" and ab=="石头":
print("很遗憾,你输了")
elif a=="布" and ab=="石头":
print("恭喜你,你赢了")
elif a=="布" and ab=="剪刀":
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