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
else:
return False
Copy the code