Pregunta de entrevista de IBM

coding question in python for the OA