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.
In [7]:
# YOUR CODE HERE
def is_palindrome(number):
if number==number[::-1]:
return 1
else:
return 0
def product(x,y):
prod=x*y
return prod
num1=1
num2=1
high=0
while num2<1000:
while num1<1000:
out= num1*num2
if is_palindrome(str(out))==1 and out>high:
high=out
num1=num1+1
num1=1
num2=num2+1
print (high)
In [2]:
# This cell will be used for grading, leave it at the end of the notebook.
In [ ]:
In [28]:
In [ ]:
In [ ]:
In [ ]: