Quick actions

cmd+k|ctrl+k

Navigation

Languages

Largest Palindrome Product

Snippet info

Language

Python

Visibility

public

Author

chaosrock

Created

2016-08-22T17:42:19Z

Updated

2016-08-22T17:42:19Z

def largest_palindrome_product(n):
    m = n
    o = n
    largest = 0
    while o > 100:
        m = n
        while m > 100:
            num = m * o
            if str(num) == str(num)[::-1]:
                if num > largest:
                    largest = num
            m -= 1
        o -= 1
    return largest
    
print(largest_palindrome_product(999))
INFO