Sat Jan 7, 2017
3 minute read

Never Iterate a Changing Dict

Yesterday I noticed a bug in a Python program that only appeared when running it with the new Python 3.6.

A slippery slope

It turned out that the program had been running a slippery slope all the time.

Read More…

Tue Dec 27, 2016
6 minute read

Python and the 36 Towers

This year my brother’s family sent us a puzzle in their Christmas package, mentioning that they already solved it and we should give it a try over the Christmas holidays, too. The puzzle is called “36 Cube” and looks like this:

36 Cube

The “36 Cube” consists of a board with a 6x6 grid of tower stubs and 36 towers in 6 different heights and colors which need to be stacked on the stubs so that they all have the same height, forming a cube like in the picture. Also, no two towers of the same color may appear in the same row or column - similar to a Sudoku puzzle.

The puzzle looked tricky already, but it turned out it was even trickier than I first thought.

Read More…

Sat Dec 24, 2016
8 minute read

The new f-strings in Python 3.6

Benchmark results

Hurray! It’s Christmas time - and Python 3.6 has been released!

One of the many goodies packed into the new release are formatted string literals, or simply called “f-strings”. In this blog post I’ll explain why this is good news.

Read More…