Just Weight and See


I'm stuck at this execise and couldn't find a similar topic here, can anyone please help me?

Error: File "python", line 26
def get_average(student):

IndentationError: unindent does not match any outer indentation level

lloyd = {
    "name": "Lloyd",
    "homework": [90.0, 97.0, 75.0, 92.0],
    "quizzes": [88.0, 40.0, 94.0],
    "tests": [75.0, 90.0]
alice = {
    "name": "Alice",
    "homework": [100.0, 92.0, 98.0, 100.0],
    "quizzes": [82.0, 83.0, 91.0],
    "tests": [89.0, 97.0]
tyler = {
    "name": "Tyler",
    "homework": [0.0, 87.0, 75.0, 22.0],
    "quizzes": [0.0, 75.0, 78.0],
    "tests": [100.0, 100.0]

# Add your function below!
def average(numbers):
   total= sum(numbers) 
   return total/len(numbers)
 def get_average(student):

    return (homework*0.1)+(quizzes*0.3)+(tests*0.6)


well, here:

 def get_average(student):

this line has indent (one space), why?

the error message tells you that there is an indention error, do you not understand the error message python throws at you?


I hadn't realized it! Solved

Thank you!


but the error message tells you this, then you check the line (line number is provided) and notice the space, right?


Yeah, but the arrow was on student so I didn't realize that the problem was before def


never trust the arrow. Just look at the type of error message, and look at the line and line above.


Thank you for helping me
I'm sorry for creating a topic for such a stupid thing


You're welcome

No problem, you have to learn to deal with error messages and stuff. Hope you learned something :slight_smile:


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