def Problem55(): maxIter = 50 iterations = 0 count = 10000 for i in xrange(1,10001): check = i iterations = 0 while(iterations < maxIter): check = nextIteration(check) if(is_palindrome(check)): count -= 1 break iterations += 1 return count
def project_euler_4(): '''Prints the largest palindrome made from the product of two 3-digit numbers. See the is_palindrome method in Euler.py for more details.''' print(max(i*j for i in range(100,1000) for j in range(100,1000) if is_palindrome(str(i*j))))