Question: python Write a function replicate(sentence), which prints or returns a longer version of the input sentence, by doubling the first word, tripling the second word,
python
Write a function replicate(sentence), which prints or returns a longer version of the input sentence, by doubling the first word, tripling the second word, quadrupling the third word, and so on. For example, replicate('This is a hot day ') produces 'ThisThis isisis aaaa hothothothothot daydaydaydaydayday ', and replicate('0 1 2 3 4 5') produces '00 111 2222 33333 444444 5555555'. The string method split() will help you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
