<jupyter_start><jupyter_text>Project Euler: Problem 4 https://projecteuler.net/problem=4A 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.<jupyter_code>def Is_Palindrome(x):
    list_x = list(str(x))
    for n in range(0,len(list_x)):
        if list_x[n] != list_x[len(list_x) - n - 1]:
            return False
            break
    return True
print(list(str(5005)))
Is_Palindrome(10033001)
def Largest_Palindrome_3digits():
    candidate_list = []
    #first test only the top 10
    for n1 in range(990,999):
        for n2 in range(990,999):
            if Is_Palindrome(n1*n2):
                candidate_list.append(n1*n2)
    if len(candidate_list) > 0:
        return max(candidate_list) + " is a product of " + str(n1) + " and " + str(n2)
    else:
    #if no palindromes are found in the last 10, test the last 100
        for n1 in range(900,999):
            for n2 in range(900,999):
                if Is_Palindrome(n1*n2):
                    candidate_list.append(n1*n2)
        if len(candidate_list) > 0:
            return str(max(candidate_list)) + " is a product of " + str(n1) + " and " + str(n2)
                
    #I could continue this pattern down to the full range, but I don't need to in this case<jupyter_output><empty_output><jupyter_text>While the palindrome is correct, the factors are not. The problem doesnt need them, so you can just ignore them.<jupyter_code>print(Largest_Palindrome_3digits())
# This cell will be used for grading, leave it at the end of the notebook.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09386068476977567, 'fraction_numerical': 0.045454545454545456, 'mean_word_length': 2.941860465116279, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '308243', 'license': 'MIT', 'n_tokens_mistral': 612, 'n_tokens_neox': 560, 'n_words': 179, 'path': 'assignments/assignment02/ProjectEuler4.ipynb', 'repo_name': 'SJSlavin/phys202-2015-work', 'size': '1694'}