Pregunta de entrevista de Workday

There was a question with some python code that processed data and I was asked to refactor it.