day1/exercise/even_perfect_4a.py
changeset 94 8c92864c184b
child 380 669b72283b55
equal deleted inserted replaced
93:27b67b50280b 94:8c92864c184b
       
     1 def all_digits_even(n):
       
     2     if n < 0: n = -n
       
     3     while n > 0:
       
     4         if n % 2 == 1:
       
     5             return False
       
     6         n /= 10
       
     7     return True
       
     8 
       
     9 i = 46
       
    10 while i <= 94:
       
    11     square = i * i
       
    12     if all_digits_even(square):
       
    13         print square
       
    14     i += 1