Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name = input()
- total_points = 301
- total_shots = 0
- successful_shots = 0
- sector = input()
- while sector != "Retire":
- current_points = int(input())
- total_shots += 1
- if sector == "Single":
- total_points -= current_points
- if total_points >= 0:
- successful_shots += 1
- else:
- total_points += current_points
- elif sector == "Double":
- total_points -= current_points * 2
- if total_points >= 0:
- successful_shots += 1
- else:
- total_points += current_points * 2
- else:
- total_points -= current_points * 3
- if total_points >= 0:
- successful_shots += 1
- else:
- total_points += current_points * 3
- if total_points == 0:
- break
- sector = input()
- if total_points == 0:
- print(f"{name} won the leg with {successful_shots} shots.")
- else:
- print(f"{name} retired after {total_shots - successful_shots} unsuccessful shots.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement