Created
July 6, 2019 14:57
-
-
Save Cyborg-Model-Z/216ef375b94e6a100e621253202db6cf to your computer and use it in GitHub Desktop.
Reverse a sentence
This file contains hidden or 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
| text = "python is fun" | |
| substring = " " | |
| def spaces(text): | |
| return (str[::text.count(" ", 0,100)]) | |
| spaces(text) | |
| print (spaces("to sit in solemn silence")) |
So you could have:
def join_spaced(items):
pass
def my_reversed(items):
pass
def split_words(text):
pass
def reverse_words(text):
return join_spaced(my_reversed(split_words(text)))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.