Advertisement
desislava_topuzakova

Untitled

Aug 9th, 2024
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. player_name = input()
  2. starting_points = 301
  3. current_points = starting_points
  4. successful_shot_counter = 0
  5. unsuccessful_shot_counter = 0
  6.  
  7. while True:
  8. command = input()
  9.  
  10. if command == 'Retire':
  11. print(f'{player_name} retired after {unsuccessful_shot_counter} unsuccessful shots.')
  12. break
  13.  
  14. type_shot = command
  15. points = int(input())
  16.  
  17. if type_shot == 'Single':
  18. points = points
  19. elif type_shot == 'Double':
  20. points = points * 2
  21. elif type_shot == 'Triple':
  22. points = points * 3
  23.  
  24. if current_points >= points:
  25. current_points -= points
  26. successful_shot_counter += 1
  27. else:
  28. unsuccessful_shot_counter += 1
  29.  
  30. if current_points == 0:
  31. print(f'{player_name} won the leg with {successful_shot_counter} shots.')
  32. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement