Commit b519fba0 by BellCodeEditor

auto save

parent c0b5d117
Showing with 19 additions and 0 deletions
import random
sh = [1,2,3]
player=input("请出拳:(石头/剪刀/布)")# 玩家出拳
print("玩家出拳:"+player)
computer = random.choice(sh) #计算机出拳
print(computer)
if player=="石头":
player = 1
if player=="剪刀":
player = 2
if player=="布":
player = 3
if player == 1 and computer==1 or player == 2 and computer==2 or player == 3 and computer==3:
print("平局")
if player==1 and computer==2 or player==2 and computer==3 or player==3 and computer==1:
print("赢了")
if player==2 and computer==1 or player==3 and computer==2 or player==1 and computer==3:
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