Files
30-seconds-of-code/test/palindrome/palindrome.py
Rohit Tanwar 385bf72a3e readme-script
2018-02-20 22:42:11 +05:30

4 lines
111 B
Python

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