Skip to content

Instantly share code, notes, and snippets.

@ghsyeung
Created February 25, 2012 03:41
Show Gist options
  • Save ghsyeung/1906078 to your computer and use it in GitHub Desktop.
Save ghsyeung/1906078 to your computer and use it in GitHub Desktop.
Reverse a string
a = "12345"
# a[i:j:k] from i to j in steps k
s = a[::-1]
print s
# '54321'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment