<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>n = 0
x = 100
y = 100
z = 0
while x < 1000: #Cycles through all of x up to 1000 (3 digit numbers)
    x = x + 1
    y = 100
    while y < 1000: #Cycles through all of y up to 1000 for each x (Not very efficient but it works in this application)
        y = y + 1
        z = y * x
        def check_palindrome(z): #This function takes the string of the product of x and y and splits it into two halves
            pal = str(z)
            leng = len(pal)
            half = int(leng/2)
            first = pal[0:int(half)] #The use of int() and round() Are used so the first half of the palindrome and the second half are the same length.
            last = pal[leng:round(half-.5):-1] #<NAME> told me that you can use the -1 to go backwards
            if first == last: #If the halves match it is a palindrome
                return True
            else:
                return False
        if check_palindrome(z) == True and z > n: #The palindrome replaces an integer n only if the palindrome is larger
            n = z
print (n)
# This cell will be used for grading, leave it at the end of the notebook.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07113259668508287, 'fraction_numerical': 0.0324585635359116, 'mean_word_length': 2.417452830188679, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '661562', 'license': 'MIT', 'n_tokens_mistral': 474, 'n_tokens_neox': 421, 'n_words': 212, 'path': 'assignments/assignment02/ProjectEuler4.ipynb', 'repo_name': 'edwardd1/phys202-2015-work', 'size': '1453'}