Question: Write a function concat _ elements ( slist , startpos, stoppos ) , where slist is a list of strings and startpos and stoppos are
Write a function concatelementsslist startpos, stoppos where slist is a list of strings and startpos and stoppos are integers, that concatenates the elements of slist starting at position startpos and ending at position stoppos inclusive and returns the resulting string.
Your code should behave reasonably for all values of startpos and stoppos: if startpos is negative, concatenation should start with the first element of slist; if stoppos lenslist concatenation should stop at the last element of slist. If startpos stoppos it should return the empty string. See the examples below.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
