LearnPy Hub
← Recursion & Lambda problems
Easy

Sort by Last Letter

Read words and print them sorted by their last letter using sorted(words, key=lambda w: w[-1]) (ties keep their order).

Input

One line.

Output

One line.

Sample 1

Input
apple banana cherry
Output
banana apple cherry

Sample 2

Input
b a
Output
a b
solution.py
Output appears here
Sort by Last Letter · Python practice problem · LearnPy Hub