Commit c96abded by BellCodeEditor

auto save

parent 220fe62b
Showing with 30 additions and 0 deletions
import random
choice = input("请出拳:(石头,剪刀,布):")
comcho_list = ["石头","剪刀","布"]
comchoice = random.choice(comcho_list)
if choice != "石头" and choice != "剪刀" and choice != "布":
print("输入错误,再输一遍吧")
else:
print("(电脑出拳:" + comchoice + ")")
if choice == "石头":
if comchoice == "石头":
print("平局")
elif comchoice == "剪刀":
print("玩家胜")
else:
print("玩家败")
elif choice == "剪刀":
if comchoice == "石头":
print("玩家败")
elif comchoice == "剪刀":
print("平局")
else:
print("玩家胜")
else:
if comchoice == "石头":
print("玩家胜")
elif comchoice == "剪刀":
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