LearnPy Hub
← Recursion & Lambda problems
Medium

Sort by Length, Then Alphabet

Read words and print them sorted by length, and words of the same length alphabetically, using a lambda that returns a tuple.

Input

Words separated by spaces.

Output

One line.

Sample 1

Input
pear fig apple kiwi
Output
fig kiwi pear apple

Sample 2

Input
b a c
Output
a b c
solution.py
Output appears here
Sort by Length, Then Alphabet · Python practice problem · LearnPy Hub