Skip to content

Instantly share code, notes, and snippets.

@jonathanpike
Created June 22, 2015 20:04
Show Gist options
  • Save jonathanpike/fd049131dd76f0ce99e3 to your computer and use it in GitHub Desktop.
Save jonathanpike/fd049131dd76f0ce99e3 to your computer and use it in GitHub Desktop.
# from http://www.practicepython.org/exercise/2014/05/21/15-reverse-word-order.html
def reversestring():
usr = raw_input("Give me a string and I will reverse it. ")
split = usr.split()
sentence_rev = " ".join(reversed(split))
print sentence_rev
reversestring()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment