simeonshopov

Devided without remainder

Oct 16th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. n = int(input())
  2. p1 = []
  3. p2 = []
  4. p3 = []
  5.  
  6. for i in range(n):
  7.   num = int(input())
  8.   if num % 2 == 0:
  9.     p1.append(num)
  10.   if num % 3 == 0:
  11.     p2.append(num)
  12.   if num % 4 == 0:
  13.     p3.append(num)
  14.    
  15. print(f"{((len(p1) / n) * 100):.2f}%\n{((len(p2) / n) * 100):.2f}%\n{((len(p3) / n) * 100):.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment