MathCo interview question

Puzzles basic python questions and logical thinking