Pergunta de entrevista da empresa General Motors (GM)

A small coding task on string in Python, nothing tricky.