Finsire interview question

a python assignment problem was asked