1 class Solution: 2 # @param s, a string 3 # @return a boolean 4 def isPalindrome(self, s): 5 d = filter(str.isalnum, s) 6 c = d[::-1] 7 if c.upper() == d.upper() : 8 return True 9 else : 10 return False
LeetCode--Valid Palindrome,布布扣,bubuko.com
原文:http://www.cnblogs.com/liruikaiyao/p/3616638.html