Teo_Yanchev

division_without_remainder_2-3-2019_exam

Jul 15th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. numbers = int(input())
  2.  
  3. p1 = 0
  4. p2 = 0
  5. p3 = 0
  6.  
  7. for i in range(1, numbers+1):
  8. num = int(input())
  9.  
  10. if num % 2 == 0:
  11. p1 += 1
  12. if num % 3 == 0:
  13. p2 += 1
  14. if num % 4 == 0:
  15. p3 += 1
  16.  
  17. print(f"{p1/numbers*100:.2f}%")
  18. print(f"{p2/numbers*100:.2f}%")
  19. print(f"{p3/numbers*100:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment