Skip to content

Instantly share code, notes, and snippets.

@pdbartsch
Last active February 7, 2019 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdbartsch/e109643a753ba9e274170212f4c83fb8 to your computer and use it in GitHub Desktop.
Save pdbartsch/e109643a753ba9e274170212f4c83fb8 to your computer and use it in GitHub Desktop.
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