FIS interview question

asked me write python code