Last active
January 15, 2019 08:25
-
-
Save PierraKimathi-zz/77d4bd9d828cf8b9fde00e7d696d8ca9 to your computer and use it in GitHub Desktop.
Reverse words in a sentence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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