veronikaaa86

08. Tennis Ranklist

Oct 2nd, 2022
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import math
  2.  
  3. tournament_count = int(input())
  4. init_points = int(input())
  5.  
  6. win_count = 0
  7. total_sum = init_points
  8. for i in range(1, tournament_count + 1):
  9.     level = input()
  10.  
  11.     if level == "W":
  12.         win_count = win_count + 1
  13.         total_sum = total_sum + 2000
  14.     elif level == "F":
  15.         total_sum = total_sum + 1200
  16.     elif level == "SF":
  17.         total_sum = total_sum + 720
  18.  
  19. print(f"Final points: {total_sum}")
  20. points_without_init = total_sum - init_points
  21. avg_points = math.floor(points_without_init / tournament_count)
  22. print(f"Average points: {avg_points}")
  23. percent_win = win_count / tournament_count * 100
  24. print(f"{percent_win:.2f}%")
Add Comment
Please, Sign In to add comment