Build a Pin Extractor - Step 15

Tell us what’s happening:

  1. The else clause should contain secret_code += ‘0’.
  2. Your code raised an error before any tests could run. Please fix it and try again.
    // tests completed

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()
        if line_index < len(words):
            # Append the length of the word at position line_index
            secret_code += str(len(words[line_index]))
        else:
            # If not enough words, append '0'
            secret_code += '0'

    return secret_code

# User Editable Region

Your browser information:

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

Challenge Information:

Build a Pin Extractor - Step 15

Reset the step.

Just read and follow the instructions. If you have a question ask it here.

Do not use an LLM or AI to complete these steps.

why this option is not being possible

1 Like

Please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge URL while still allowing you to ask any question about the challenge or your code.

Thank you.