Contact: aviboots(AT)netvision.net.il
39,939 questions
51,876 answers
573 users
lst = [3.14, 5.34, 7.89, 2.13, 2.12, 1.177, 1.176, 5.5999, 5.9998] lst.sort(key = float) print(lst) ''' run: [1.176, 1.177, 2.12, 2.13, 3.14, 5.34, 5.5999, 5.9998, 7.89] '''
lst = [3.14, 5.34, 7.89, 2.13, 2.12, 1.177, 1.176, 5.5999, 5.9998] lst = sorted(lst, key = float) print(lst) ''' run: [1.176, 1.177, 2.12, 2.13, 3.14, 5.34, 5.5999, 5.9998, 7.89] '''