Advertisement
BbJLeB

05. Tennis Ranklist

May 30th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. # 05. Tennis Ranklist
  2. import math
  3. tournament = int(input())
  4. start_points = int(input())
  5. current_points = 0
  6. all_wins = 0
  7. moment_points = 0
  8.  
  9. for i in range(tournament):
  10.  
  11.     stage = input()
  12.     if stage == "W":
  13.         current_points += 2000
  14.         moment_points += 2000
  15.         all_wins += 1
  16.     elif stage == "F":
  17.         current_points += 1200
  18.         moment_points += 1200
  19.     else:
  20.         current_points += 720
  21.         moment_points += 720
  22.  
  23. final_points = current_points + start_points
  24. average_points = math.floor(moment_points / tournament)
  25. win_tournaments = (all_wins/ tournament) * 100
  26. print(f"Final points: {final_points}")
  27. print(f"Average points: {average_points}")
  28. print(f"{win_tournaments:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement