#Skip to menu

Largest palindrome product

First read the problem description.
def is_palindrome(n):
    t = n
    reverse = 0
    while t > 0:
        reverse *= 10
        reverse += t%10
        t //= 10
    return n == reverse

def products(lowerlim, upperlim):
    products = []
    for a in range(lowerlim, upperlim):
        b = a
        while b <= upperlim:
            products.append(a*b)
            b += 1
    return sorted(products, reverse = True)
    
next(p for p in products(100, 1000) if is_palindrome(p))
906609

Source code of the solution(s):