mirror of
https://github.com/rasbt/python_reference.git
synced 2025-04-16 01:27:36 +00:00
Update palindrome.py
This commit is contained in:
parent
47e4aca99c
commit
0704f2b81c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
def palindrome(my_str):
|
def palindrome(my_str):
|
||||||
"""
|
"""
|
||||||
Returns True if an input string is a palindrom
|
Returns True if an input string is a palindrome. Else returns False.
|
||||||
"""
|
"""
|
||||||
stripped_str = "".join([l.lower() for l in my_str if l.isalpha()])
|
stripped_str = "".join([l.lower() for l in my_str if l.isalpha()])
|
||||||
return stripped_str == stripped_str[::-1]
|
return stripped_str == stripped_str[::-1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user