sorted和sort() li = [9, 1, 8, 2, 7, 3, 6, 4, 5] s_li = sorted(li) print ('Sorted Variable: \t', s_li) li.sort() print ('Original Variable: \t', li) 输出结果: Sorted Variable: [1, 2, 3, 4, 5, 6, 7, 8, 9] Original Variable: [1, 2, 3, 4, 5, 6, 7, 8, 9] 如果: l…