python array sort by float value code example Example: sorting decimal numbers in python list1.sort(key=float)