Infosys interview question

Oops , and some python concepts