def list_function(x):

x[1] = x[1]+3

return x[1]

n = [3, 5, 7]

print list_function(n)

def list_function(x):

x[1] = x[1]+3

return x[1]

n = [3, 5, 7]

print list_function(n)

Instruction says:

Return the list.

Your function returns only the changed value. Return `x`

only just worked it out myself. for some reason, they don't want the list *n* at all. the code they want is

**def list_function(x):**

**x[1] += 3**

**return x**

or

**def list_function(x):**

**x[1] = x[1] + 3**

**return x**

def list_function(x):

x[1] = x[1] + 3

return x

n = [3, 5, 7]

list_function(n)

print n

Try this one. For me it worked

Shouldn't it work the same with

return n

instead return x?

If not, I don't understand

thank you

yes, you can also write it as

```
def list_function(n):
n[1] += 3
return n
or
def list_function(n):
n[1] = n[1] + 3
return n
```

The idea is that you need the variable (in this case *n*) to be the same all the way through the `def function`

What I was trying to say, was that there is a bug in the codecademy code checker.

The question asks for

```
def list_function(n):
n[1] += 3
return n
n = [3, 5, 7]
print list_function(n)
```

The answer checker only wanted

```
def list_function(n):
n[1] += 3
return n
```

****They may have fixed this bug now. I'm not sure.****

n = [3, 5, 7]

def double_list(x):

for i in range(0, len(x)):

x[i] = x[i] * 2

`return x`

print double_list(n)

The guide said: "When we pass a list to a function and modify that list, like in the double_first function above, we end up modifying the original list."

Why do i need to return x if the list is modified already?

I have done the exact code that you put down but it doesn't seem to work. Yes, I did put the indents on.

Same here...

def list_function(x):

n[1] = n[1] + 3

return x

n = [3, 5, 7]

print list_function(n)

Why doesn't it work?

I'm sure you figured that out already, but you have both x's and n's in the first bit of your code. Should be just one of these.

def list_function(*x*):

**n**[1] = **n**[1] + 3

return *x*

So

def list_function(x):

x[1] = x[1] + 3

return x

This is the proper way to do it:

n = [3, 5, 7]

def double_list(x):

for i in range(0, len(x)):

x[i] = x[i] * 2

return x

print double_list(n)

watch out for the identation on:

return x

return x should be on the same line with:

for i in range(0, len(x)):

this is because the return function is not in the loop but a result of the loop.

Thank you

I was stuck here for 5 days. Only stupid answers out there.

My mistake was ''(0, len(n)):'' - and I corrected as you said to ''(0, len(x)):''

Thank you !!!