Capgemini Interview Question

few question on python strings and loops easy level