Simplify3x interview question

Python questions, basics with little bit of simple coding