DiYane

Divide without remainder 5/8

Aug 6th, 2021
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. count = int(input())
  2.  
  3. divisible2 = 0
  4. divisible3 = 0
  5. divisible4 = 0
  6.  
  7. for i in range(count):
  8.     currentNum = int(input())
  9.  
  10.     if currentNum % 2 == 0:
  11.         divisible2 += 1
  12.     if currentNum % 3 == 0:
  13.         divisible3 += 1
  14.     if currentNum % 4 == 0:
  15.         divisible4 += 1
  16.  
  17. print(f"{(divisible2 / count * 100):.2f}%")
  18. print(f"{(divisible3 / count * 100):.2f}%")
  19. print(f"{(divisible4 / count * 100):.2f}%")
  20.  
Advertisement
Add Comment
Please, Sign In to add comment