# 17/18 Stuck

Hi everyone, stuck on this exercise, current code is

m = [1, 2, 3]
n = [4, 5, 6]

def join_lists(x, y):
result = x
for i in range(len(y)):
result += y(i)
return result

print join_lists(m, n)

Thanks

it is a little too complicated you coded. follow the sample in the instruction of this task:

``` def join_lists(x,y): (indent)return x + y ```

yeah bro you did way too much here

can i ask why you don’t need to use a for loop on this?

1 Like

This is what I did and it worked, you need to read the instructions carefully:
def join_lists(x,y):
return x+y
join_lists()
print join_lists(m,n)

`` m = [1, 2, 3]
n = [4, 5, 6]

def join_lists(x, y):
joined = x + y
return joined

print join_lists(m, n)``

This is what I did. I don’t like calling return and creating the variable ‘joined’, in my case, all in one step. It’s probably not a big deal but it’s easier for me to see what’s happening in the code.

1 Like

Hello,

Personally, i don’t use varaiable just the return.

``````m = [1, 2, 3]
n = [4, 5, 6]

def join_lists(x, y):
return x + y

print join_lists(m, n)
# You want this to print [1, 2, 3, 4, 5, 6]
``````

Result :
[1, 2, 3, 4, 5, 6]
None

m = [1, 2, 3]
n = [4, 5, 6]