@@ -0,0 +1,1884 @@
+'''%0AProblem 4%0A%0AA palindromic number reads the same both ways. The largest palindrome made from%0A  the product of two 2-digit numbers is 9009 = 91 %C3%97 99.%0A%0AFind the largest palindrome made from the product of two 3-digit numbers.%0A%0A%0ASolution:%0ACopyright 2017 Dave Cuthbert %0ALicense MIT%0A'''%0A%0Adef check_if_palindrome(number):%0A    end_index = -1%0A    mid_point = int(len(number) / 2)%0A    for begin_index in range(mid_point + 1):%0A        if number%5Bbegin_index%5D != number%5Bend_index%5D:%0A            break%0A        if begin_index %3E= mid_point:%0A            return True%0A%0A        end_index -= 1%0A    return False%0A%0A%0Adef get_biggest_palindrome(upper_limit):%0A    for number in reversed(range(10000, upper_limit)):%0A        if check_if_palindrome(str(number)):%0A            return number    %0A%0A%0Adef factor_number(number):%0A    # Range upper limit = 999 + 1%0A    for divisor_1 in reversed(range(100,1000)):%0A        if number %25 divisor_1 == 0:%0A            divisor_2 = int(number / divisor_1)%0A            if ((len(str(divisor_1)) == len(str(divisor_2))) and%0A                (len(str(divisor_1)) == 3)):%0A                # If factorable and 3 digits return the divisors%0A                return (0, divisor_1, divisor_2)%0A%0A    # If no factors, return the palindrome instead%0A    return (number, 0, 0)%0A%0A%0Adef check_palindromes():%0A    # Range upper limit starts with (999 * 999) + 1%0A    upper_limit = 998002%0A    %0A    while True:%0A        palindrome = get_biggest_palindrome(upper_limit)%0A        solution = factor_number(palindrome)%0A    %0A        if solution%5B0%5D == 0:%0A            # Factors were found%0A            return(solution%5B1%5D, solution%5B2%5D)%0A        else:%0A            # No factors were found%0A            upper_limit = solution%5B0%5D%0A%0A%0Adef solve_problem():%0A    solution = check_palindromes()%0A%0A    return (solution%5B0%5D, solution%5B1%5D, solution%5B0%5D * solution%5B1%5D)%0A           %0A%0Aif __name__ == %22__main__%22:%0A        print(solve_problem())%0A

Solve problem 004