Advertisement
PythonNinja

Untitled

Dec 7th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. numbers_count = int(input())
  2.  
  3. p1 = 0
  4. p2 = 0
  5. p3 = 0
  6.  
  7. for i in range(numbers_count):
  8.     current_number = int(input())
  9.     if current_number % 2 == 0:
  10.         p1 += 1
  11.     if current_number % 3 == 0:
  12.         p2 += 1
  13.     if current_number % 4 == 0:
  14.         p3 += 1
  15.  
  16. p1 = p1 / numbers_count * 100
  17. p2 = p2 / numbers_count * 100
  18. p3 = p3 / numbers_count * 100
  19.  
  20. print(f'{p1:.2f}%')
  21. print(f'{p2:.2f}%')
  22. print(f'{p3:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement