Pergunta de entrevista da empresa Tata Consultancy Services

For in python how to write?