You have a collection of lovely poems. Unfortuantely they aren't formatted very well. They're all on one line, like this:

```
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated.
```
What you want is to present each sentence on a new line, so that it looks like this:
```
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
```
Write a function, `format_poem()` that takes a string like the one line example as an argument and returns a new string that is formatted across multiple lines with each new sentence starting on a new line when you print it out.

Try to solve this challenge with the [str.split()](https://docs.python.org/3/library/stdtypes.html#str.split) and the [str.join()](https://docs.python.org/3/library/stdtypes.html#str.join) string methods.

Every sentence will end with a period, and every new sentence will have one space before the previous period. Be careful about trailing whitespace in your solution.

Difficulty: introductory

Starter code:

def format_poem(poem):
	

Solutions:
def format_poem(poem):
  return ".\n".join(poem.split(". "))

def format_poem(poem):
    return poem.replace(". ", ".\n")


def format_poem(poem):
    lines = poem.split('. ')
    return '.\n'.join(lines)
  
   
    
         
    


from re import sub

# Try to solve this challenge with the str.split() and the str.join() string methods.
# -> No
def format_poem(poem):
    return sub(r"(?<=\.)\s", "\n", poem)

def format_poem(poem):
    lines = poem.replace('. ','.\n')
    return lines
    


def format_poem(poem):
    poem = poem.split('. ')
    result = '.\n'.join(poem)
    return result


format_poem = lambda p:'.\n'.join(p.split(". "))


format_poem = __import__("functools").partial(__import__("re").sub, r"(?<=\.)\s", "\n")

def format_poem(poem):
    # Your code goes here.
    poem_new = poem.replace('. ', '.\n') 
    return poem_new
    


def format_poem(s):
    a, r = s.split('.'), []
    for k,i in enumerate(a):
        if k == 0:r.append(i.lstrip())
        else:r.append('\n'+i.lstrip())
    return ('.'.join(r)).rstrip('\n')