Log Puzzle Python Exercise