Commit 120b8c0b by BellCodeEditor

save project

parent 848a426b
Showing with 13 additions and 8 deletions
from random import * from random import *
from random import * from random import *
player=str(input()) player=str(input('玩家请出拳:'))
list1=['剪刀','石头','布'] list1=['剪刀','石头','布']
print('玩家出拳:',player) if player in list1:
computer=choice(list1) print('玩家出拳:',player)
if player=='剪刀': computer=choice(list1)
print('计算机出拳:',computer)
if player=='剪刀':
if computer=='剪刀': if computer=='剪刀':
print('impossble!') print('impossble!')
elif computer=='石头': elif computer=='石头':
print('computer!') print('computer!')
else: else:
print('player!') print('player!')
elif player=='石头': elif player=='石头':
if computer=='石头': if computer=='石头':
print('impossble!') print('impossble!')
elif computer=='剪刀': elif computer=='剪刀':
print('player!') print('player!')
else: else:
print('computer!') print('computer!')
else: else:
if computer=='石头': if computer=='石头':
print('player!') print('player!')
elif computer='剪刀': elif computer=='剪刀':
print('computer!') print('computer!')
else: else:
print('impossble!') print('impossble!')
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