# Build a Pin Extractor - Step 17

**URL:** <https://forum.freecodecamp.org/t/build-a-pin-extractor-step-17/790494>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [June 2, 2026, 7:05am UTC](https://forum.freecodecamp.org/t/build-a-pin-extractor-step-17/790494 "2026-06-02T07:05:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samkalpak](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/samkalpak/32/416354_2.png) [@samkalpak](https://forum.freecodecamp.org/u/samkalpak)\
**Post date:** [June 2, 2026, 7:05am UTC](https://forum.freecodecamp.org/t/build-a-pin-extractor-step-17/790494/1 "2026-06-02T07:05:42Z")

</div>

### Tell us what’s happening:

def pin\_extractor(poems):  
for poem in poems:  
secret\_code = ‘’  
lines = poem.split(‘\n’)

```auto
    for line_index, line in enumerate(lines):
        words = line.split(' ')

        if len(words) > line_index:
            secret_code += str(len(words[line_index]))
        else:
            secret_code += '0'

```

### Your code so far

```py

# User Editable Region

def pin_extractor(poems):
    for poem in poems:
        secret_code = ''
        lines = poem.split('\n')

        for line_index, line in enumerate(lines):
            words = line.split(' ')

            if len(words) > line_index:
                secret_code += str(len(words[line_index]))
            else:
                secret_code += '0'

# 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/148.0.0.0 Safari/537.36`

### Challenge Information:

Build a Pin Extractor - Step 17

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/python-v9/workshop-pin-extractor/step-17)**
>
> Learn to Code — For Free

GitHub Link: [https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/workshop-pin-extractor/68599f0fc7479410b2269742.md](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/workshop-pin-extractor/68599f0fc7479410b2269742.md)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 2, 2026, 9:30am UTC](https://forum.freecodecamp.org/t/build-a-pin-extractor-step-17/790494/2 "2026-06-02T09:30:06Z")

</div>

Please **Tell us what’s happening** in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [June 30, 2026, 9:30am UTC](https://forum.freecodecamp.org/t/build-a-pin-extractor-step-17/790494/3 "2026-06-30T09:30:22Z")

</div>

Closed on June 30, 2026, 9:30am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
