Commit 120b8c0b by BellCodeEditor

save project

parent 848a426b
Showing with 28 additions and 24 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)
if computer=='剪刀': print('计算机出拳:',computer)
print('impossble!') if player=='剪刀':
elif computer=='石头': if computer=='剪刀':
print('computer!') print('impossble!')
elif computer=='石头':
print('computer!')
else:
print('player!')
elif player=='石头':
if computer=='石头':
print('impossble!')
elif computer=='剪刀':
print('player!')
else:
print('computer!')
else: else:
print('player!') if computer=='石头':
elif player=='石头': print('player!')
if computer=='石头': elif computer=='剪刀':
print('impossble!') print('computer!')
elif computer=='剪刀': else:
print('player!') print('impossble!')
else:
print('computer!')
else: else:
if computer=='石头': print('出拳选项无法识别!')
print('player!') \ No newline at end of file
elif computer='剪刀':
print('computer!')
else:
print('impossble!')
\ 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