Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player_name = input()
- starting_points = 301
- current_points = starting_points
- successful_shot_counter = 0
- unsuccessful_shot_counter = 0
- while True:
- command = input()
- if command == 'Retire':
- print(f'{player_name} retired after {unsuccessful_shot_counter} unsuccessful shots.')
- break
- type_shot = command
- points = int(input())
- if type_shot == 'Single':
- points = points
- elif type_shot == 'Double':
- points = points * 2
- elif type_shot == 'Triple':
- points = points * 3
- if current_points >= points:
- current_points -= points
- successful_shot_counter += 1
- else:
- unsuccessful_shot_counter += 1
- if current_points == 0:
- print(f'{player_name} won the leg with {successful_shot_counter} shots.')
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement