Build a Pin Extractor - Step 17

Tell us what’s happening:

im not sure why this is throwing back “you should move the existing body of the function into the new for loop.” i have read over the lessons and even googled nesting for statements and my syntax LOOKS right so what am i doing wrong? :sob:

Your code so far


# User Editable Region

def pin_extractor(poems):
       

    
    for poem in poems:
        poems=[poem1, poem2, poem3]
        for line_index, line in enumerate(lines):
            
            secret_code = ''
            words = line.split()
            lines = poems.split('\n')
            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\nhere and there\nhoping for rain\nbefore it turns yellow'
poem3 = 'There\nonce\nwas\na\ndragon'
# print(pin_extractor(poems))

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:150.0) Gecko/20100101 Firefox/150.0

Challenge Information:

Build a Pin Extractor - Step 17

and please, give me a straight answer. im not looking for a hint im looking for clarification on nested for statement syntax because obviously im doing something wrong but no docs ive read have even remotely given me a straight answer that i can understand.

if not

for blah blah blah:
    for blah blah blah:
    return 

then what am i missing?

moved some stuff around, not really sure what fixed it but here we are

Have you solved this now?

yes i have sorry for the delay life be lifin