Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

finding palindrome in python

is_palindrome = lambda phrase: phrase == phrase[::-1]

print(is_palindrome('anna')) # True 
print(is_palindrome('rats live on no evil star')) # True 
print(is_palindrome('kdljfasjf')) # False 
Source by zerotomastery.io #
 
PREVIOUS NEXT
Tagged: #finding #palindrome #python
ADD COMMENT
Topic
Name
3+4 =