Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- counter1 = 0
- counter2 = 0
- counter3 = 0
- counter4 = 0
- counter5 = 0
- for i in range(1, n+1):
- num = int(input())
- if num < 200:
- counter1 +=1
- elif num >= 200 and num <= 399:
- counter2 +=1
- elif num >= 400 and num <= 599:
- counter3 +=1
- elif num >= 600 and num <= 799:
- counter4 +=1
- elif num >= 800:
- counter5 +=1
- p1 = counter1 / n *100
- p2 = counter2 / n *100
- p3 = counter3 / n *100
- p4 = counter4 / n *100
- p5 = counter5 / n *100
- print(f"{p1:.2f}%")
- print(f"{p2:.2f}%")
- print(f"{p3:.2f}%")
- print(f"{p4:.2f}%")
- print(f"{p5:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement