Build a Pin Extractor - Step 17

Tell us what’s happening:

my code Is correct but it says on the bottom:

You should move the existing body of the function into the new for loop

Your code so far


# User Editable Region

def pin_extractor(poems):
    secret_code = ''
    for poem in poems:  
        lines = poem.split('\n')
        for line_index, line in enumerate(lines):
            words = line.split()
            if len(words) > line_index:
                secret_code += str(len(words[line_index]))
            else:
                secret_code += '0'
    return secret_code

# User Editable Region



poem1 = """Stars and the moon
shine in the sky
white and
until the end of the night"""

poem2 = """The grass is green
here and there
hoping for rain
before it turns yellow"""

poem3 = """There
once
was
a
dragon"""

print(pin_extractor([poem1, poem2, poem3]))

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3.1 Safari/605.1.15

Challenge Information:

Build a Pin Extractor - Step 17

you should move everything inside the loop, there are two lines that are not inside the loop