Skip to content

Instantly share code, notes, and snippets.

@mos3abof
Last active April 28, 2018 19:37
Show Gist options
  • Save mos3abof/6fea9168d09c527225b809b729d43565 to your computer and use it in GitHub Desktop.
Save mos3abof/6fea9168d09c527225b809b729d43565 to your computer and use it in GitHub Desktop.
Function to determine whether a string is a palindrome
def is_palindrome(s):
return all(s[i] == s[~i] for i in range(len(s) // 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment