Commit a9cb8d6b by BellCodeEditor

save project

parent eaaae8bb
Showing with 18 additions and 3 deletions
# 玩家出拳
paly=input("请输入(石头,剪刀,布):")
print("玩家出:"+play)
\ No newline at end of file
import random
play=input("请输入(石头,剪刀,布):")
list=["石头","剪刀","布"]
cop=random.choice(list)
if play in list:
print("玩家出:"+play)
print("电脑出拳:"+cop)
if play ==cop:
print("平局")
elif(play =="石头"and cop=="剪刀")or(play=="剪刀" and cop=="布")or(play=="布"and cop=="石头"):
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