Infosys Interview Question

A question about python coding