pyassistant

String Sorting

Write a function that takes a list of strings as input and returns a new list with the strings sorted in ascending order based on their lengths. If two strings have the same length, they should be ordered in the same order as they appear in the original list.

Example:

Input:
['banana', 'apple', 'orange', 'kiwi']
Output:
['kiwi', 'apple', 'banana', 'orange']

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.