Join Two Lists
Join Two Lists
Tags: Data Structures Basics
Credit: CodingChallenge
Difficulty: Beginner
Type: Text
Category: Practice
Time Allowed: 5 s
Description:
Write a function that takes two lists and returns a new list that is the concatenation of the two input lists. This problem is designed to help you practice joining lists
. The function should accept two parameters and return the combined list.
Constraints:
- Both inputs will be
lists
of elements. - The function should
return
alist
that is the concatenation of the two input lists.
Example:
- Input:
[1, 2, 3], [4, 5, 6]
- Output:
[1, 2, 3, 4, 5, 6]
Test Case | Input | Expected Output |
---|---|---|
1 | [[1, 2, 3], [4, 5, 6]] | [1, 2, 3, 4, 5, 6] |
2 | [[], [1, 2]] | [1, 2] |
3 | [['a', 'b'], ['c', 'd']] | ['a', 'b', 'c', 'd'] |
4 | [[True, False], [False, True]] | [True, False, False, True] |
5 | [[1], []] | [1] |
6 | [[], []] | [] |
7 | [[1, 2], [3, 4, 5]] | [1, 2, 3, 4, 5] |
Leave a Comment
Please login to leave a comment.