Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n_count = int(input())
- p1 = 0
- p2 = 0
- p3 = 0
- p4 = 0
- p5 = 0
- countp1 =0
- countp2 =0
- countp3 =0
- countp4 =0
- countp5 =0
- for x in range(1, n_count+1):
- current_num = int(input())
- if current_num < 200:
- countp1 += 1
- p1 = (countp1 / n_count) * 100
- elif 200<= current_num <400:
- countp2 += 1
- p2 = (countp2 / n_count) * 100
- elif 400 <= current_num < 600:
- countp3 += 1
- p3 = (countp3 / n_count) * 100
- elif 600 <= current_num < 800:
- countp4 += 1
- p4 = (countp4 / n_count) * 100
- elif current_num >= 800:
- countp5 += 1
- p5 = (countp5/ n_count) * 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