Files
30-seconds-of-code/test/palindrome/palindrome.py
2018-02-20 14:39:09 +05:30

4 lines
114 B
Python

def palindrome(string):
from re import sub
s = sub('[\W_]', '', string.lower())
return s == s[::-1]