Advertisement
exDotaPro

9_march_2019_5_tennis_ranklist

Jan 10th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. from math import floor as fl
  2.  
  3. tournaments = int(input())
  4. rank_list_starting_points = int(input())
  5.  
  6. points_won = 0
  7. tournaments_won = 0
  8.  
  9. for parts in range(tournaments):
  10.     stage = input()
  11.  
  12.     if stage == 'W':
  13.         points_won += 2000
  14.         tournaments_won += 1
  15.  
  16.     elif stage == 'F':
  17.         points_won += 1200
  18.  
  19.     elif stage == 'SF':
  20.         points_won += 720
  21.  
  22. average_points = points_won / tournaments
  23. percentage_tournaments_won = (tournaments_won / tournaments) * 100
  24.  
  25. print(f'Final points: {points_won + rank_list_starting_points}')
  26. print(f'Average points: {fl(average_points)}')
  27. print(f'{percentage_tournaments_won:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement