Build a Pin Extractor - Step 12

Tell us what’s happening:

help , what have I done wrong here…?

Your code so far


# User Editable Region

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


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

pin_extractor(poem)

# User Editable Region


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.1 Safari/605.1.15

Challenge Information:

Build a Pin Extractor - Step 12

you have the return inside the loop, don’t you think that can cause some issues?

1 Like