Commit 5d066081 by BellCodeEditor

save project

parent ef9fc908
Showing with 15 additions and 12 deletions
import random import random
player = input("请出拳(石头/剪刀/布):")
a = input("请出拳(石头/剪刀/布):") print("玩家出拳"+player)
list=["石头","剪刀","布"]
if ["剪刀", "石头", "布"] computer=random.choice(list)
if player in list:
print("输入正确")
if player==computer:
= [["石头", "剪刀"], ["剪刀", "布"], ["布", "石头"]] print("平局")
computer = random.choice(b) elif (player=="石头" and computer=="剪刀") or (player=="剪刀" and computer=="布") or (player=="布" and computer=="石头"):
print("你出拳:"+player) print("你赢了")
print("计算机出拳:"+computer) else:
\ No newline at end of file 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