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
readline
to read lines, the line-break is included, solen(text)
will be one character more than expected. Strip your strings! - When doing number of
if
–elif
–elif
–elif
, make sure to include anelse
, even though you know that all cases are covered. I runassert False
in 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.