Commit c1e7a534 by BellCodeEditor

auto save

parent 3e202459
Showing with 22 additions and 0 deletions
import random
onr = input("玩家请出拳(剪刀/石头/布)? ")
list=["石头","剪刀","布"]
to=random.choice(list)
print("玩家出拳 "+onr)
print("计算机出拳 "+to)
if onr in list:
if onr==to:
print("平局")
elif onr=="石头"and"剪刀"==to:
print("玩家胜出")
elif onr=="剪刀"and"布"==to:
print("玩家胜出")
elif onr=="布"and"石头"==to:
print("玩家胜出")
else:
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