Given a string s, return true if it is a palindrome, or false otherwise.
import re
class Solution(object):
def isPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
s = s.replace(" ","").lower()
s = re.sub('[^a-z0-9]+', '', s)
if (len(s)==0):return True
else:
for i in range(int(len(s)/2)):
if (s[i] == s[-(i+1)]):
continue
else :
return False
return True