Cogito Interview Question

I was asked to sort some examples data using base python.