Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stadium_capacity = int(input())
- football_fans = int(input())
- sector_a = 0
- sector_b = 0
- sector_v = 0
- sector_g = 0
- for i in range(football_fans):
- sector = input()
- if sector == 'A':
- sector_a += 1
- elif sector == 'B':
- sector_b += 1
- elif sector == 'V':
- sector_v += 1
- elif sector == 'G':
- sector_g += 1
- print(f'{sector_a / football_fans * 100:.2f}%')
- print(f'{sector_b / football_fans * 100:.2f}%')
- print(f'{sector_v / football_fans * 100:.2f}%')
- print(f'{sector_g / football_fans * 100:.2f}%')
- print(f'{football_fans / stadium_capacity * 100:.2f}%')
- Фундаменталс решение:
- stadium_capacity = int(input())
- football_fans = int(input())
- sectors = {'A': 0, 'B': 0, 'V': 0, 'G': 0}
- for i in range(football_fans):
- sectors[input()] += 1
- for i in sectors:
- print(f'{sectors[i] / football_fans * 100:.2f}%')
- print(f'{football_fans / stadium_capacity * 100:.2f}%')
Add Comment
Please, Sign In to add comment