❤leetcode,python2❤给定一个字符串,验证它是不是回文串,只考虑字母和数字字符,能够忽略字母的大小写。

class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ s = filter(str.isalnum, str(s)).lower() if s == s[::-1]: return True
相关文章
相关标签/搜索