words = ['car', 'apple', 'door', 'banana', 'pasta']


# def get_length(w):
#     return len(w), w
#
# x = get_length  # FUNCTIONS ARE 1ST CLASS CITIZENS

print(sorted(words, key=lambda w: (len(w), w)))

fc57956153c8bbec67c0c734d21bd616a4e738bc
<mask token>

<mask token>
print(sorted(words, key=lambda w: (len(w), w)))

words = ['car', 'apple', 'door', 'banana', 'pasta']
print(sorted(words, key=lambda w: (len(w), w)))

words = ['car', 'apple', 'door', 'banana', 'pasta']


# def get_length(w):
#     return len(w), w
#
# x = get_length  # FUNCTIONS ARE 1ST CLASS CITIZENS

print(sorted(words, key=lambda w: (len(w), w)))
