mirror of
https://github.com/rasbt/python_reference.git
synced 2025-02-07 09:01:03 +00:00
Merge branch 'master' of https://github.com/rasbt/python_reference
This commit is contained in:
commit
d4c466134d
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
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]
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user