python 2 sort code example Example: how to sort a list in python with if a = [1, 1, 2, 3, 5, 8, 13, 3, 34, 55, 89] print([aa for aa in a if aa <5])