how to sort lists using sorted function in python