Teo_Yanchev

tennis_ranklist_9-10-2019_exam

Jul 15th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. from math import floor
  2. tournament = int(input())
  3. opening_points = int(input())
  4.  
  5. points_count = 0
  6. win_count = 0
  7.  
  8. for games in range(1, tournament+1):
  9. stage_in_tournament = input()
  10. if stage_in_tournament == "W":
  11. win_count += 1
  12. points_count += 2000
  13. elif stage_in_tournament == "F":
  14. points_count += 1200
  15. else:
  16. points_count += 720
  17. total_points = points_count + opening_points
  18. print(f"Final points: {total_points}")
  19. average = points_count / tournament
  20. print(f"Average points: {floor(average)}")
  21. percent_won = (win_count / tournament) * 100
  22. print(f"{percent_won:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment