Skip to content

Instantly share code, notes, and snippets.

@roopeshvaddepally
Created January 13, 2011 05:29
Show Gist options
  • Save roopeshvaddepally/777451 to your computer and use it in GitHub Desktop.
Save roopeshvaddepally/777451 to your computer and use it in GitHub Desktop.
Reverse the words in a sentence seperated by spaces
a = "put in the required sentence"
# reverse splice the sentence split by space, then join with space
" ".join(a.split(" ")[::-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment