寻找最大回文数字
Project Euler 第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.
回文数(palindromic number)是值是指类似121对称的数字,将该数按照相反的顺序排列后,所得到的数和原来的一样。
在Python,判断是否回文的办法:
def ispalindrom(num):
num=str(num)
return num==num[::-1]
完整代码见:large-palindrome-made-from-3-digit.py
相关下载:
相关阅读
tags: python,智力题,Project Euler