Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created May 20, 2018 19:54
Show Gist options
  • Select an option

  • Save accessnash/45129cfbe31e81030552fa075ef0d08d to your computer and use it in GitHub Desktop.

Select an option

Save accessnash/45129cfbe31e81030552fa075ef0d08d to your computer and use it in GitHub Desktop.
Find the largest palindrome made from the product of two 3-digit numbers. - Project Euler
def isPalindrome(a,b):
s = str(a*b)
if s == s[::-1]:
return True
palinlist = []
for i in range(999, 101, -1):
for j in range(999, 101, -1):
num = i*j
if isPalindrome(i,j):
palinlist.append(num)
print(max(palinlist))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment