Skip to content

Instantly share code, notes, and snippets.

@riyadhalnur
Created December 2, 2015 09:53
Show Gist options
  • Save riyadhalnur/fdb4aa68cee1d8784109 to your computer and use it in GitHub Desktop.
Save riyadhalnur/fdb4aa68cee1d8784109 to your computer and use it in GitHub Desktop.
Reverse a string in Python
def reverse(text):
reversed = []
for i in range(len(text)):
reversed.append(text[-(i+1)])
return ''.join(reversed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment