Build a Pin Extractor - Step 6

Tell us what’s happening:

I failed to put the words variable inside the loop. Failed test. Print job executed. Please comment.

Your code so far


# User Editable Region

def pin_extractor(poem):
    secret_code = ''
    lines = poem.split('\n')
    for line in lines:
        print(line)
    for line in lines:
        words=line.split()
        if words:
            word=('\n')
            print(words)


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 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0

Challenge Information:

Build a Pin Extractor - Step 6

Please point out where in the instructions it tells you to add a for loop and an if statement?

I suggest you reset the step and only do exactly as asked here:

" inside the loop, create a variable words and assign to it the value of line split into words using the split method.

Then, add a print call with words as its argument. inside the loop, create a variable words and assign to it the value of line split into words using the split method.

Then, add a print call with words as its argument."