Infosys interview question

A question about python coding