Advertisement
BbJLeB

07. Football League

May 31st, 2019
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. # 07. Football League
  2. capacity = int(input())
  3. fens = int(input())
  4. sector = ''
  5. secA = 0
  6. secB = 0
  7. secV = 0
  8. secG = 0
  9. i = 0
  10. while i < fens:
  11.     sector = input()
  12.     if sector == "A":
  13.         secA += 1
  14.     elif sector == "B":
  15.         secB += 1
  16.     elif sector == "V":
  17.         secV += 1
  18.     elif sector == "G":
  19.         secG += 1
  20.     i += 1
  21. secA = secA / fens * 100
  22. secB = secB / fens * 100
  23. secV = secV / fens * 100
  24. secG = secG / fens * 100
  25. average_fens = fens / capacity * 100
  26. print(f"{secA:.2f}%")
  27. print(f"{secB:.2f}%")
  28. print(f"{secV:.2f}%")
  29. print(f"{secG:.2f}%")
  30. print(f"{average_fens:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement