Result Size: 625 x 571
demo_ref_list_sort4.py:
x
 
# A function that returns the length of the value:
def myFunc(e):
  return len(e)
cars = ['Ford', 'Mitsubishi', 'BMW', 'VW']
cars.sort(reverse=True, key=myFunc)
print(cars)
C:\Users\My Name>python demo_list_sort4.py
['Mitsubishi', 'Ford'', 'BMW', 'VW']