Advertisement
miglenabs

Untitled

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