Easy
Next With a Default
Make an iterator over the input words with
iter(). Call next(it, 'done') k times and print each result on its own line.Input
Words; then k.
Output
k lines.
Sample 1
Input
a b 3
Output
a b done
Sample 2
Input
x y z 2
Output
x y
Output appears here