Created
December 7, 2020 12:00
-
-
Save akionsight/1250de70c835ba593edf2853441249ab to your computer and use it in GitHub Desktop.
Checks for palindromes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def palindrome_checker(word): | |
reversed_word = word[::-1] | |
if reversed_word == word: | |
return True | |
else: | |
return False | |
# print(palindrome_checker('racecar')) -> returns True | |
# print(palindrome_checker('Joshua')) -> returns False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment