Learn
Using multiple lists in a function is no different from just using multiple arguments in a function!
a = [1, 2, 3] b = [4, 5, 6] print a + b # prints [1, 2, 3, 4, 5, 6]
The example above is just a reminder of how to concatenate two lists.
Instructions
1.
Create a function that joins two lists together.
- On line 5, define a function called
join_lists
that has two arguments,x
andy
. They will both be lists. - Inside that function,
return
the result of concatenatingx
andy
together.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.