Pregunta de entrevista de Tata Consultancy Services

Logical Questions and Python regarding question