SHARE
TWEET

Divide without remainder

aneliabogeva May 20th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2.  
  3. counter_devided_2 = 0
  4. counter_devided_3 = 0
  5. counter_devided_4 = 0
  6.  
  7. for i in range(0,n):
  8.     num = int(input())
  9.     if num % 2 == 0:
  10.         counter_devided_2 +=1
  11.     if num % 3 == 0:
  12.         counter_devided_3 +=1
  13.     if num % 4 == 0:
  14.         counter_devided_4 +=1
  15.  
  16. p1 = counter_devided_2 / n *100
  17. p2 = counter_devided_3 / n *100
  18. p3 = counter_devided_4 / n *100
  19.  
  20. print(f"{p1:.2f}%")
  21. print(f"{p2:.2f}%")
  22. print(f"{p3:.2f}%")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top