A solution of the Exercism.io Python challenge "bob"