Build a Pin Extractor - Step 14

Tell us what’s happening:

always has errors, Idk if its even the right code

I tried adjusting indentation, added a pass to the end but only caused more errors, I searched the forums and couldn’t find an answer. I think i have a wrong idea.

Your code so far

def pin_extractor(poem):
    secret_code = ''
    lines = poem.split('\n')
    for line_index, line in enumerate(lines):
      words = line.split()
# User Editable Region
        
    if len.words > line.index:
        
       secret_code += str(len(words[line_index]))
         
    return secret_code
# User Editable Region



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

print(pin_extractor(poem))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36

Challenge Information:

Build a Pin Extractor - Step 14

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-pin-extractor/6855918e87c33c6979d21d3f.md at main · freeCodeCamp/freeCodeCamp · GitHub

is this how you check the length of something?

No it isnt, Figured it out, Thank you