Identation issue


I am doing this exercise and I am wondering why sometimes I get indentation issues. In the code below, you see two functions, in the fist one, def average, the indentation is shorter than in def get_average. When I tried to run def get_average with the same indentation as def average, I got a syntax error (marked after quizzes=average(student[“quizzes”]) ), but when changed it to 4 spaces, it worked; whereas def average works without any issues with that indentation.
Basically, I just don’t understand why the different indentation levels for both functions.

# Add your function below!
def average(numbers):
  return total/len(numbers)
def get_average(student):
    return 0.1*homework+0.3*quizzes+0.6*tests


codecademy got updated to the new learning enviroment, there still seems to be some indention issues which need sorting.


Ok, thanks! I am new here so I have not seen other environment than the present one. I was getting very confused, but I suspected it should not be a problem of how I was writing the code but more of how it was being processed.


yes, exactly. So don’t worry about it, you are doing fine :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.