Skip to content

Instantly share code, notes, and snippets.

@PierraKimathi-zz
Last active January 15, 2019 08:25
Show Gist options
  • Save PierraKimathi-zz/77d4bd9d828cf8b9fde00e7d696d8ca9 to your computer and use it in GitHub Desktop.
Save PierraKimathi-zz/77d4bd9d828cf8b9fde00e7d696d8ca9 to your computer and use it in GitHub Desktop.
Reverse words in a sentence
def reverse_words(str):
return ' '.join(s[::-1] for s in str.split(' '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment