Last active
February 7, 2019 16:17
-
-
Save pdbartsch/e109643a753ba9e274170212f4c83fb8 to your computer and use it in GitHub Desktop.
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 stringlists(): | |
s = input("please enter a string a.k.a. some text ") | |
# extended slice syntax with negative 1 step reverses the string ([begin:end:step]) | |
if s[::-1].lower() == s.lower(): | |
return 'Cool! That string was a palindrome.' | |
else: | |
return "That string wasn't a palindrome." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment