python_ref_list_sort_5.py:
x
 
# A function that returns the length of the value:
def myFunc(e):
  return len(e)
cars = ['Porsche', 'Audi', 'BMW', 'VW']
cars.sort(reverse=True, key=myFunc)
print(cars)