Expected an idented block ? (python code challenge.)

I got an error from Python : list challenge. I have no idea about indented block and how to fix this error. I need help. :sob:

Hello @wiiconstantle. In Python, the way the compiler knows that code is in a function, loop, etc, is if it is indented. Because you have your function, append_sum, but no indented code, it throws an error, as it expects some:

def some_function():
  print("This is indented 2 spaces")

That code does not throw an error, as the code is correctly indented.

def some_function():
print("This is not indented at all")

That code throws an error, because the print() statement should have been indented.
I hope this helps!

3 Likes

Oh, got ya. I got that silly mistake after fixing the code several times. Thank you!

1 Like

@wiiconstantle I just use sublime and copy and paste the code back into codeacademy. Just much easier to manage all the formatting. I find it particularly helpful on the longer projects

1 Like

You re right. thanks!