Pregunta de entrevista de Tata Consultancy Services

For in python how to write?