Modifying an element of a list in a function - unexpected indent


#1

https://www.codecademy.com/courses/learn-python/lessons/lists-and-functions/exercises/modifying-an-element-of-a-list-in-a-function?action=lesson_resume

< error messages >
File “python”, line 3
return x
^
IndentationError: unexpected indent

<What do you expect to happen instead?>
n = [3, 8, 7]

```python

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

n = [3, 5, 7]
list_function(n)
print n

<do not remove the three backticks above>
Hi there, hm somehow I cannot find the reason why it does not work.

#2

this two lines:

  x[1] = x[1] + 3
	return x

do not have the same indent level, they should have the same indent level


#3

Ok, thank you. I found the reason. I had some whitespace in before “return x”.


#4