Write a function `concat` which takes as input a list of strings L and returns the list obtained by concatenating the strings in L (in their natural order. For example, a call `concat(['hi', '', 'there'])` should return the string `'hi there'`. If L is an empty list, then the call `concat(L)` should return an empty string. Hint: All problems from this assignment can be solved by a suitable use of the accumulator pattern (see Video 14). In []: def concat(L): In []: assert concat(['hi','', 'there']) == 'hi there' In []: assert concat([]) ==
Added by Maria S.
Close
Step 1
Sure, what Show more…
Show all steps
Your feedback will help us improve your experience
Rosemary Charnley and 82 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
My third time submitting this to Numerade. I’m stuck, someone please help.
Ivan K.
Hi everyone, I need help with this question I already done the code but it doesn't work. I just gave up.
Gio M.
can someone walk me through this please
Christopher D.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD