← Back to challenges

Concatenate Variable Number of Input Lists

PythonHardlanguage_fundamentalsarrays

Instructions

Create a function that concatenates n input lists, where n is variable.

Examples

concat([1, 2, 3], [4, 5], [6, 7]) ➞ [1, 2, 3, 4, 5, 6, 7]

concat([1], [2], [3], [4], [5], [6], [7]) ➞ [1, 2, 3, 4, 5, 6, 7]

concat([1, 2], [3, 4]) ➞ [1, 2, 3, 4]

concat([4, 4, 4, 4, 4]) ➞ [4, 4, 4, 4, 4]

Notes

Lists should be concatenated in order of the arguments.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Syncopated Rhythm