►
Run
x = ['banana', 'apple', 'cherry', 'orange'] result = sorted(x, key=len) print(result)
Output