Sorting Python list based on the length of the string,xs.sort(key=len)