Emergent Software interview question

Solve a small problem in Python