diff --git a/algorithms/python/ValidPalindrome/isPalindrome.py b/algorithms/python/ValidPalindrome/isPalindrome.py new file mode 100644 index 00000000..43259c2a --- /dev/null +++ b/algorithms/python/ValidPalindrome/isPalindrome.py @@ -0,0 +1,12 @@ +class Solution: + def isPalindrome(self, s: str) -> bool: + temp = "" + + for i in s: + if i.isalpha() or i.isdigit(): + temp = (temp+i).lower() + + if temp[::-1] != temp: + return False + else: + return True \ No newline at end of file