Pregunta de entrevista de Infosys

it was a python Coding question