Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. n = int(input())
  2. i = 0
  3. while n > 0:
  4.     n //= 10
  5.     i += 1
  6. print(i)
  7. ----------
  8. n = int(input())
  9. i = 0
  10. while n > 0:
  11.     if n % 2 == 0:
  12.         i += 1
  13.     n //= 10
  14. print(i)
  15. -----------
  16. n = int(input())
  17. i = n % 10
  18. while n > 9:
  19.     n //= 10
  20. print(i + n)
  21. ------------
  22. n = int(input())
  23. i = 1
  24. s = 0
  25. while i <= n // 2  + 1:
  26.     if n % i == 0:
  27.         s += i
  28.     i += 1
  29. print(s == n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement