Continuing a set of journal entries where I’m working through Automate the Boring Stuff with Python to strengthen my logic and programming skills. Been in management for close to 6 years now and I’m beginning to feel my logic skills atrophy. I’m hoping that by working through this book on a weekly basis while practicing Leetcode-style questions will help sharpen those skills to the point of where I was 5 years ago.
I plan to keep a log here and continue to learn in public. I’ll be tracking the progress this Github repo.
🗓️ Dates Covered:
- 2025-04-21 - 2025-04-28
📚 What I Studied
- Chapter(s) covered: 5
- Concepts I focused on: Dictionaries!
- Challenges or problems attempted:
- Chess Board validator at the end of Chapter 5
- Worked with ChatGPT to come up with Leetcode style problems to test my logic, such as:
- Counting and organizing a list of spells based on their category
- Creating a multiplayer Tic-Tac-Toe game
- Building a Spellbook when given a list of spells and their categories
🧠 What I Learned
- Key takeaways:
- Using
setdefaultis a great way to keep track of unique values in a dictionary - Writing out the problem and solution in plain English sentences is a good way to fully understand and break down the problem.
- Using
dict.get(key, 0)is a safe way to prevent Python from throwing an error if the key is not present - Looping through nested dictionaries
- Using
🔁 Repeated Patterns or Skills Practiced
- Looping through dictionaries with key, value iterators in loops
- The importance of defensive coding while using
dict.get()instead of directly accessing the key-value throughdict[key]
⚔️ Challenges I Faced
-
Problem(s) that tripped me up:
- Breaking down the chessboard validator into smaller functions
- Looping through nested dictionaries caused some initial confusion, but printing and debugging clarified where I was at in a given loop(s)
-
What I misunderstood at first:
- Looping through nested dictionaries can be confusing if trying to work out the values in sub-loops in my head
-
How I solved or reframed it:
- Write down a quick paragraph of how I’m going to solve it in English, then convert that to pseudo code before jumping into Python
✅ Wins of the Week
- Starting to get a good strategy of how I break down and decompose problems: writing. I have always been a strong writer and I can use that to my advantage to think through logical steps in breaking down a challenge.
🔮 What’s Next
- Topics I plan to tackle next week:
- Chapter 6 and continuing to nail down the logic problems
- Goals for the next 7 days:
- Work on 2 logic problems per day
- Questions or curiosities I want to explore:
- How do I know when I can move on to true Leetcode style problems?
🧾 Favorite Snippet of the Week
def pretty_print_spells(spells):
pretty_spells = ""
for category in spells:
if(category == 'fire'):
emoji = '🔥'
elif (category == 'healing'):
emoji = '❤️'
else:
emoji = '💫'
pretty_spells += f"{emoji} {category.capitalize()}: \n"
for spell, k in spells[category].items():
pretty_spells += f"- {spell.capitalize()}: {k} \n"
print(pretty_spells)