Capgemini Engineering interview question

Python based for me