Adding two lists


Why can't you just do "print m + n" to print the combination of the two lists?

Instead of this:
m = [1, 2, 3]
n = [4, 5, 6]

def join_lists(x, y):
return x + y
print join_lists(m, n)

Couldn't you do this instead:
m = [1, 2, 3]
n = [4, 5, 6]

print m + n

I just tried "print m + n" and it worked. Why does code academy tell you to do all this other complicated nonsense just to add to lists? You don't need to define new functions. I'm confused.


What makes you say that you can't?


I tried it and it DID work. But the instructions say

On line 4, define a function called join_lists that has two arguments, x and y. They will both be lists.
Inside that function, return the result of concatenating x and y together.


Yeah you can do that but that exercise expects you to implement that in a function.
This lessons is trying to introduce you to the concepts of functions and why you need them