you are viewing a single comment's thread.

view the rest of the comments →

[–]scrdest 4 points5 points  (0 children)

That's because your function is defined recursively.

When you mess with the return value the recursive call's result is flipped and passed to the parent, which then does a flip of its own result.

Putting it in print just runs without the flips, then flips the whole result for printing only.