Advertisement
HristoBaychev

Football League

Feb 1st, 2023
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. capacity_stadium = int(input())
  2. number_of_fan = int(input())
  3.  
  4. team_one = 0
  5. team_two = 0
  6.  
  7. A = 0
  8. B = 0
  9. V = 0
  10. G = 0
  11.  
  12. average_fan = 0
  13.  
  14. for i in range(number_of_fan):
  15.     sector = input()
  16.     if sector == 'A':
  17.         A += 1
  18.     elif sector == 'B':
  19.         B += 1
  20.     elif sector == 'V':
  21.         V += 1
  22.     elif sector == 'G':
  23.         G += 1
  24.  
  25. A = (A / number_of_fan) * 100
  26. B = (B / number_of_fan) * 100
  27. V = (V / number_of_fan) * 100
  28. G = (G / number_of_fan) * 100
  29. average_fan = (number_of_fan / capacity_stadium) * 100
  30.  
  31.  
  32. print(f'{A:.2f}%')
  33. print(f'{B:.2f}%')
  34. print(f'{V:.2f}%')
  35. print(f'{G:.2f}%')
  36. print(f'{average_fan:.2f}%')
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement