Files
30-seconds-of-code/test/palindrome/palindrome.py
2018-02-16 16:09:18 +05:30

4 lines
111 B
Python

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