Star Unpacking
Completed
Read a line of words. Print the first word, the last word, and the number of words in between — using first, *middle, last = ....
Input
One line with at least 2 words.
Output
Three lines.
Example
Input
a b c d e
Output
a e 3
Editor
Python
Hints
A starred name collects all the leftover items into a list.
Solution explanation
Extended unpacking with * works with any iterable.
Show solution
first, *middle, last = input().split()
print(first)
print(last)
print(len(middle))