Capgemini interview question

few question on python strings and loops easy level