W28: Summer of Python

July 13, 2025 ยท Weeknotes

I’ve been working on Python a bit more casually but now decided to make it a focus of my summer. Inspired by CGP Grey, it’s the summer of Python. And I’ll be writing weeknotes to keep myself accountable.

Where I’m starting from: familar with loops, variables, funtions, classes… but never put all these together to make any concrete project or in production code. At work I use Python ocassionally to write scripts for different data tasks and Jupyter Notebooks for analysis. My implementations get the job done but I’m keen on learning more Pythonic ways of approaching things.

The goal more concretely is to improve my problem solving using Python, learn more advanced features (standard library, common libraries) and building small personal tools. Losely the plan over the next few weeks is to:


This week I worked through the following Exercism tasks: Resistor Color Expert, Secret Handshake, Anagram, House and Binary Search . Took a lot of detours and learned about a few things that were new to me:

:g - the general formatter for floats which chooses between fixed-point and scientific notation, depending on the value.It defaults to 6 significant digits unless you specify a precision with .Ng where N is the significant digits.

f"{123456.789:g}"    # โ†’ '123457'
f"{0.000012345:g}"   # โ†’ '1.2345e-05'
f"{123.0:g}"         # โ†’ '123'
f"{123456.789:.2g}"  # โ†’ '1.2e+05'
f"{0.0123456:.4g}"   # โ†’ '0.01235'
f"{123.456:.5g}"     # โ†’ '123.46'

Reversing lists - I kept getting TypeError as I tried to enumerate over mylist.reverse() directly. Some reminders on reversing lists:

bisect module - learned about this module while consulting Claude on alternative solutions binary search. The module provides efficient binary search operations on sorted lists, allowing you to find insertion points and maintain sorted order without implementing binary search yourself. It has 3 common operations:


Overall a good week. I struggled the most when I started writing the solution as I thought of the logic. To try in the future, map out the complete logic on paper before typing in the IDE. Next week: more exercism workouts, work my way throug Grokking Algorithms and try ship my bookshelf implementation of libro.