W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
python_ref_list_sort_3.py:
# A function that returns the length of the value: def myFunc(e): return len(e) cars = ['Porsche', 'Audi', 'BMW', 'VW'] cars.sort(key=myFunc) print(cars)