Teo_Yanchev

L5_Division_14

Jun 25th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. n = int(input())
  2.  
  3. p1 = 0
  4. p2 = 0
  5. p3 = 0
  6.  
  7. for numbers in range(1, n+1):
  8. current_numbers = int(input())
  9. if current_numbers % 2 == 0:
  10. p1 += 1
  11. if current_numbers % 3 == 0:
  12. p2 += 1
  13. if current_numbers % 4 == 0:
  14. p3 += 1
  15.  
  16. print(f"{(p1 / n) * 100:.2f}%")
  17. print(f"{(p2 / n) * 100:.2f}%")
  18. print(f"{(p3 / n) * 100:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment