Build a Pin Extractor - Step 3

Tell us what’s happening:

what is missing in my code I have done what has been asked

Your code so far


# User Editable Region

def pin_extractor(poem):
    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 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build a Pin Extractor - Step 3

Hi

Note that it says to put the variable outside the function. What changes do you need to make to your code to achieve that?

Here is my modified code but it is still not cleared, where am I going wrong at here

I made changes and thought I had it but I’m still missing or not understanding what I did wrong


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

def pin_extractor(poem): secret_code = '' pass poem = '''Stars and the moon shine in the sky white and bright until the end of the night'''

def pin_extractor(poem): return poem

result = pin_extractor(poem) print(result)

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

that does not look correct, you are defining pin_extractor twice… maybe reset the step, then try again

you need to write outside the function in this step

1 Like

I’ve tried formatting the code in your posts but the indenting is getting lost which is extremely important.

Try posting again and use triple backticks as @ILM has described.

```
code goes here
```

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

def pin_extractor(poem):
    secret_code = ''
    pass
    poem = '''Stars and the moon
shine in the sky
white and bright
until the end of the night'''

def pin_extractor(poem):
    return poem

result = pin_extractor(poem)

You have two function definitions. You must only have one function definition.

did you reset the step? you have lots of stuff extra, you should really reset the step

You were close with what you originally posted. You need to adjust the code so that what you added is outside the function.

2 Likes
poem = '''Stars and the moon
    shine in the sky
    white and bright
    until the end of the night'''
    #I have placed the code outside of function
def pin_extractor(poem):
    secret_code =''
    pass
    poem = '''Star and the moon
    shine in the sky
    white and bright
    until the end of the night'''
    pin_extractor(poem)

the function call is inside the function, please move it outside the function

The instructions do not ask for this

poem = '''Stars and the moon
shine in the sky
white and bright
until the end of the night'''
pass
def pin_extractor(poem):
    secret_code =''
    pass
    return None

    pin_extractor(poem)
#Why is it still asking me to call the function pin_extractor with poem as argument>

the function call is still inside the function, everything indented under def pin_extractor(poem): is inside the function, to put something outside the remove the indentation

1 Like