Emergent Software Interview Question

Solve a small problem in Python