Build a Pin Extractor - Step 12

Tell us what’s happening:

I think the instruction should require us to write ‘return secret_code’ at the end of the loop.

Instead, the instruction says that we write ‘return secret_code’ at the last line of the function.

People extremely new to coding might find it difficult to know what the instruction is actually asking them to do.

Your code so far

def pin_extractor(poem):
    secret_code = ''
    lines = poem.split('\n')
    for line_index, line in enumerate(lines):

# User Editable Region

        print(line_index, line)
        words = line.split()
        print(str(len(words[line_index])))
        secret_code += str(len(words[line_index]))
    

# User Editable Region



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

pin_extractor(poem)

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a Pin Extractor - Step 12

wouldn’t “at the end of the loop” mean inside the loop? that would not be the correct position

if you have suggestions to improve the challenges you can open an issue on github