pavlinski78

Untitled

Dec 5th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. n=int(input())
  2. p1=0
  3. p2=0
  4. p3=0
  5. p4=0
  6. p5=0
  7. for number in range(1, n+1):
  8.     current_num=int(input())
  9.     if current_num<200:
  10.         p1+=1
  11.     elif current_num>199 and current_num<400:
  12.         p2+=1
  13.     elif current_num>399 and current_num<600:
  14.         p3+=1
  15.     elif current_num>599 and current_num<800:
  16.         p4+=1
  17.     else:
  18.         p5+=1
  19. print(f"{p1/n*100:.2f}%")
  20. print(f"{p2/n*100:.2f}%")
  21. print(f"{p3/n*100:.2f}%")
  22. print(f"{p4/n*100:.2f}%")
  23. print(f"{p5/n*100:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment