Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I just need some guidance, I\'m not really sure where to start. I dont want some

ID: 2246713 • Letter: I

Question

I just need some guidance, I'm not really sure where to start. I dont want someone to just post the whole code. This is in Python.

Write a function concat_elements(list, startpos, stoppos), wherelist is a list of strings and startpos and stoppos are integers, that concatenates the elements of list 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 andstoppos: if startpos is negative, concatenation should start with the first element of list; if stoppos len(list), concatenation should stop at the last element of list. If startpos > stoppos it should return the empty string. See the examples below

Explanation / Answer

I do appreciate your courage that you didnt ask for whole code....

first declare a string (let it be s) = list[startpos]
then we can do is loop i from startpos+1 to stoppos
   and within the loop we can perform s += list[i] where i is loop variable

Once you come out of the loop you have your resultant string.