Skip to content

Instantly share code, notes, and snippets.

@Sangram92
Last active February 4, 2016 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sangram92/4ee79a48f934ecb5c60e to your computer and use it in GitHub Desktop.
Save Sangram92/4ee79a48f934ecb5c60e to your computer and use it in GitHub Desktop.
def reverse_word_order(sentence):
words = sentence.split(" ")
reverse_list = words[::-1]
reverse = ''
for i in reverse_list:
reverse = reverse +' '+ ''.join(i)
print reverse
reverse_word_order('My name is Sangram')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment