products = []

"""
Explanation: Project Euler: Problem 4
https://projecteuler.net/problem=4
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
Create empty list of products
End of explanation
"""


for i in range(1, 1000):
    for n in range(1,1000):
        products.append(i * n)

"""
Explanation: Add the products of all 3-digit numbers to the list
End of explanation
"""


pals = []

"""
Explanation: Create empty list of palindromes
End of explanation
"""


def check_for_palindromes(products):
    for number in products:
        if number == int(str(number)[::-1]):
            pals.append(number)
    return(pals)

"""
Explanation: Check if number is a palindrome, return list of palindromes
End of explanation
"""


print(max(check_for_palindromes(products)))

"""
Explanation: Print maximum from list of palindromes
End of explanation
"""


# This cell will be used for grading, leave it at the end of the notebook.

"""
Explanation: Success!
End of explanation
"""


