Building a Poetry Pin Extractor with Python

🚀 Day 3 of #freeCodeCamp: Building a "Poetry" Pin Extractor! 🕵️♂️ Today’s project was a fun exercise in string manipulation and nested iteration. I built a Python function that extracts hidden PINs from poems. The Logic: The code scans each poem and takes the length of a specific word from every line (Line 1 -> Word 1, Line 2 -> Word 2, etc.) to form a secret code. Key Technical Wins: ✅ Multi-line String Parsing: Using .split('\n') to break down text blocks. ✅ Index Safety: Implementing 'if' checks to ensure the code doesn't crash if a line is too short. ✅ Enumerate in Action: Using enumerate(lines) to perfectly sync the line number with the word index. It’s a great example of how simple logic can be used to "decode" hidden patterns in data. --- 💡 Question for the devs:  In your early days of learning, what was the first "mini-tool" you built that actually worked? Onward to Day 4! 🛠️ #100DaysOfCode #Python #Programming #CodingChallenge #freeCodeCamp #BuildInPublic #SoftwareEngineering #StringManipulation

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories