Question: Write a Python code which takes a sentence as an input, e.g., sentence = this is a long sentence, and returns the list of words,
Write a Python code which takes a sentence as an input, e.g., sentence = this is a long sentence,
and returns the list of words, sorted in the order by word length, e.g., [(1, a), (2, is), (4, long), (4, this), (8, sentence)].
You may use list.sort() or sorted() functions for sorting.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
