Advertisement
Spocoman

Division Without Remainder

Feb 13th, 2022 (edited)
77
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 = 0.0
  3. p2 = 0.0
  4. p3 = 0.0
  5.  
  6. for i in range(n):
  7.     number = int(input())
  8.     if number % 2 == 0:
  9.         p1 += 1
  10.     if number % 3 == 0:
  11.         p2 += 1
  12.     if number % 4 == 0:
  13.         p3 += 1
  14.  
  15. print(f'{(p1 / n * 100):.2f}%')
  16. print(f'{(p2 / n * 100):.2f}%')
  17. print(f'{(p3 / n * 100):.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement