""" palindrome.py In class exercise looking at Project Euler problem 4 i.e. 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. Jim Mahoney | March 2018 """ def search(n): """ look at each pair of n-digit numbers """ # (a,b) will be the numbers # For n=2, loop a from 10 (smallest) to 99 (biggest) inclusive. # second number can loop from a+1 to 99, # since we can have the smaller number be a. smallest = 10**(n-1) biggest = 10**n - 1 print "n is ", n print " smallest ", smallest print " biggest ", biggest #for a in range(smaller, bigger+1): def main(): search(2) main()