Advent of Code and Learning

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, so len(text) will be one character more than expected. Strip your strings!
  • When doing number of ifelifelifelif, make sure to include an else, even though you know that all cases are covered. I run assert 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.

This entry was posted in Miscellaneous. Bookmark the permalink. Both comments and trackbacks are currently closed.
  • December 2020
    M T W T F S S
     123456
    78910111213
    14151617181920
    21222324252627
    28293031