#石头剪刀布
import random
#玩家输入
player = 0
while player!='石头' and player!='剪刀' and player!='布':
player = input('出拳(石头、剪刀、布):')
if player=='石头' or player=='剪刀' or player=='布':
break
print('请输入正确信息')
if player=='石头':
player=1
elif player=='剪刀':
player=2
elif player=='布':
player=3
#电脑随机
computer=random.randint(1,3)
if computer==1:
print('computer:石头')
elif computer==2:
print('computer:剪刀')
elif computer==3:
print('computer:布')
#比较
if player==computer:
print('平局')
elif ((player<computer and computer-player==1)
or(player>computer and computer-player==-2)):
print('you win')
elif ((player>computer and computer-player==-1)
or(player<computer and computer-player==2)):
print('computer win')