判断输入的是否为回文

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

def isPalindrome(s):
	def toChars(s):
		s = s.lower()
		ans = ''
		for c in s:
			if c in 'abcdefghijklmnopqrstuvwxyz':
				ans = ans + c
		return ans
	def isPal(s):
		if len(s)<=1:
			return True
		else:
			return s[0]==s[-1] and isPal(s[1:-1])
	return isPal(toChars(s))