I taught myself Python a few years ago by following the wonderful Learn Python the Hard Way (LPTHW) series by Zed A. Shaw. Since then, I have spent a decent amount of time in Python largely in the Django framework. Django is a lot of fun to work with because it abstracts away much of the complexities of developing a full-featured web application in Python. In this way, however, it has also led me to forget some of the basic Python that I learned through LPTHW.
In order to recapture some of those early lessons (and maybe learn a few more Python 3 specific ones), I worked through (part of) the 2017 Advent of Code, a 25-day, language agnostic programming challenge series developed by Eric Watsl. I originally thought about using the series to learn a new language, but eventually realized that I still have a long way to go in Python.
This series explores my (often very basic) revelations and lessons learned while completing 20 of the 25 days of challenges (vacation travel cut the series short for me). The code I used for each day is available on GitHub. Also check out the advent-of-code and advent-of-code-2017 GitHub topics to see the many solutions people have developed in various languages.
- Day 1: zip()
- Day 2: itertools.combinations()
- Day 3: Manhattan Distance
- Day 4: set()
- Day 5: Profiling
- Day 6: max(x, key=y)
- Day 7: RuntimeError: dictionary changed size during iteration
- Day 8: Regular Expressions
- Day 9: Lookahead, Lookbehind
- Day 10: functools.reduce()
- Day 11: Navigating a Hexagon Grid
- Day 12: Recursion
- Day 13: Shallow vs. Deep Copy
- Day 14: Hexadecimal to Binary
- Day 15: progressbar2
- Day 16: One Billion Permutations in 0.535 Seconds
- Day 17: collections.deque()
- Day 18: Negative Numbers and str.isdigit()
- Day 19: The Internet is Not a Big Truck
- Day 20: Reading from a File