16-石头剪刀布

import random

all_choices = ['石头', '剪刀', '布']
computer = random.choice(all_choices)
player = input('请出拳: ')

print('Your choice:', player, "Computer's choice:", computer)

print("Your choice: %s, Computer's choice: %s" % (player, computer))
if player == '石头':
if computer == '石头':
print('平局')
elif computer == '剪刀':
print('You WIN!!!')
else:
print('You LOSE!!!')
elif player == '剪刀':
if computer == '石头':
print('You LOSE!!!')
elif computer == '剪刀':
print('平局')
else:
print('You WIN!!!')
else:
if computer == '石头':
print('You WIN!!!')
elif computer == '剪刀':
print('You LOSE!!!')
else:
print('平局')

import  random

all_choices = ['石头','剪刀','布']
computer = random.choice(all_choices)
player = input('请出拳:')

print("Your choice: %s, Computer`s choice: %s" % (player,computer))
if player == '石头':
    if computer == '石头':
        print('平局')
    elif computer == '剪刀':
        print('you win!!!')
    else:
        print('you lose!!!')
elif player == '剪刀':
    if computer == '剪刀':
        print('平局')
    elif computer == '布':
        print('you win!!!')
    else:
        print('you lose!!!')
else:
    if computer == '石头':
        print('you win!!!')
    elif computer == '剪刀':
        print('you lose!!!')
    else:
        print('平局')

你可能感兴趣的:(16-石头剪刀布)