python_ref_list_sort_3.py:
x
 
# 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)