Dec-15-2020, 01:06 AM
This is slightly tricky, because at the end you only have a ".", but between the sentences you have ". ". So a simple substitution makes it look a bit wonky.
So I might first replace all ". " with ".", then replace those with ".\n".
So I might first replace all ". " with ".", then replace those with ".\n".
s = 'I want to be a developer. I also want to learn AWS. I am going to practice joining strings.' s = s.replace(". ", ".") s = s.replace(".", ".\n") print(s)
Output:I want to be a developer.
I also want to learn AWS.
I am going to practice joining strings.