Advertisement
ALEXANDAR_GEORGIEV

tennis_ranklist_2

Jun 17th, 2022
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. from math import floor
  2.  
  3. tournaments_count = int(input())
  4. start_points = int(input())
  5. final_points = start_points
  6. w_points = 0
  7. f_points = 0
  8. sf_points = 0
  9. count_of_wins = 0
  10.  
  11. for tournament in range(1, tournaments_count + 1):
  12.     stage_of_tournament = input()
  13.     if stage_of_tournament == 'W':
  14.         final_points += 2000
  15.         w_points += 2000
  16.         count_of_wins += 1
  17.     if stage_of_tournament == 'F':
  18.         final_points += 1200
  19.         f_points += 1200
  20.     if stage_of_tournament == 'SF':
  21.         final_points += 720
  22.         sf_points += 720
  23.  
  24. average_points = (w_points + f_points + sf_points) / tournaments_count
  25. wins_percent = count_of_wins / tournaments_count * 100
  26.  
  27. print(f"Final points: {final_points}")
  28. print(f"Average points: {floor(average_points)}")
  29. print(f'{wins_percent:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement