human
Sorting Python list based on the length of the string
assistant
Here is some code to sort list `xs` in ascending order of length of elements

xs.sort(lambda x, y: cmp(len(x), len(y)))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.