class Solution:
def isPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
if(s==" "):
return True
str=''
for i in s:
if(i.isalpha() or i.isdigit()):
str=str+i
else:
continue
str=str.lower()
#print(str)
return (list(reversed(str))==list(str))
相关文章: