LearnPy Hub
← Recursion & Lambda problems
Easy

Sort by Length

Read words and print them sorted by length (shortest first); words of equal length keep their input order.

Input

One line of words.

Output

One line.

Sample 1

Input
banana kiwi fig apple
Output
fig kiwi apple banana

Sample 2

Input
a bb a
Output
a a bb
solution.py
Output appears here
Sort by Length · Python practice problem · LearnPy Hub