Advertisement
Guest User

05. Divide Without Remainder

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