Posts

Learn Python in 30 Days — Day 22: Lists & Dictionary Comprehensions

Image
Day 22: Lists & Dictionary Comprehensions Welcome to  Day 22  of the  Learn Python in 30 Days  series! Today we get into one of Python’s cleanest “superpowers”: comprehensions . These let you build lists, dictionaries, and sets in a single, readable line, perfect for filtering data, transforming it, or generating new structures without writing full loops. By the end of today, you’ll know how to: Turn long loops into compact one-liners Build new lists from existing data Filter items based on conditions Create dictionaries on the fly Use comprehensions with nested structures This is the kind of Python feature that instantly makes your code cleaner and easier to read. All example files for this series are available on my  GitHub: Learn-Python-in-30-Days What Is a Comprehension? A comprehension is a compact way to create a new list or dictionary by looping over something. squares = [] for n in range ( 1 , 6 ): squares.append(n * n) ...

Building a Overdrive Pedal Kit

Image
Building a Overdrive Pedal Kit Today I’m building a overdrive guitar pedal kit from a bare PCB, it came with no instructions, and I wanted to show how it can still be built. This one uses two 4558 op-amps, like the classic Boss and Tube Screamer circuits, so it should sound really good when it's finished. Let’s dive in.” Resistors First  Always start with resistors because they sit low on the PCB and make soldering clean and easy. On this board, everything is clearly labelled. Diodes and Small Caps Next we add the two 1N4148 diodes for the clipping stage. Orientation matters, match the black band on the diode to the band on the PCB. Then I added the larger black Diode, being sure to orientate the band correctly. Small Caps Next we add all the smaller capacitors, I like to lay them out and label them so that they are easily identified. Then I solder them into position one by one. To help keep them in place whilst soldering, try using Blu-tack over the components s...

Learn Python in 30 Days — Day 21 Week 3 Challenge: Daily Journal CLI App

Image
     Day 21 - Challenge: Daily Journal CLI App  Welcome to  Day 21  of the  Learn Python in 30 Days  series! By now you’ve used: Functions (Day 15–16) Error handling with try / except (Day 17) File handling (Day 18) Modules (Day 19–20) Today, we’re going to glue all of that together and build a proper little project: A Daily Journal CLI App that’s split into: journal_core.py → your self-made module with all the logic journal_cli.py → a tiny command-line interface that imports and uses it  The goal isn’t just “make a journal”, it’s to think like a developer : split code into sensible pieces, give each function a job, and wire it all together. All example files for this series are available on my  GitHub: Learn-Python-in-30-Days What You’ll Build A core module : journal_core.py Which handles: getting today’s date adding entries viewing all entries viewing entries for a specific date file + error handlin...