Sorting A List In Python Using For Loop