Run
my_list = ['cherry', 'watermelon', 'fig', 'apple'] my_list.sort(key=lambda x: len(x)) print(my_list)
Output