veronikaaa86

08. Tennis Ranklist

Mar 20th, 2022 (edited)
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import math
  2.  
  3. tournament_count = int(input())
  4. init_points = int(input())
  5.  
  6. sum_points = 0
  7. win_count = 0
  8. for i in range(1, tournament_count + 1):
  9.     level = input()
  10.  
  11.     if level == "W":
  12.         win_count = win_count + 1
  13.         sum_points = sum_points + 2000
  14.     elif level == "F":
  15.         sum_points = sum_points + 1200
  16.     elif level == "SF":
  17.         sum_points = sum_points + 720
  18.  
  19. total_points = sum_points + init_points
  20. print(f"Final points: {total_points}")
  21. avg_points = math.floor(sum_points / 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