So, I decided to do Advent of Code this year too. I usually get stuck part of the way, but I still think that it is a fun exercise.
This year the plan is to use python and pytest the whole way through. Every day that i learn something that I want to remember, I add a
til.txt file in that sub-directory. You can follow my progress and learnings in the git repository.
The lessons this far includes:
- When using
readlineto read lines, the line-break is included, so
len(text)will be one character more than expected. Strip your strings!
- When doing number of
elif, make sure to include an
else, even though you know that all cases are covered. I run
assert Falsein the else clause.
As you can see, these are on the level of small snippets of wisdom right now. I’m sure it will be more interesting as the problems become more complex.