Just Weight and See (Indent?)


#1



https://www.codecademy.com/courses/python-beginner-en-qzsCL/1/2?curriculum_id=4f89dab3d788890003000096


IndentationError: unindent does not match any outer

I want the output to calculate the average.

 def get_average(student):
     homework = average(student["homework"])
     quizzes = average(student["quizzes"])
     tests = average(student["tests"])
     
grade = 0.1*homework + 0.3*quizzes + 0.6*tests
return grade


#2

These lines are outside the function.


#3

Tried that:

def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
grade = 0.1*homework + 0.3*quizzes + 0.6*tests
return grade

Still didn't work!


#4

The lines i mentioned should be aligned with the homework, quizzes, and tests lines.
Check your indentations for homework, quizzes and tests as well....seems like they have an extra few spaces.


#5

You need to get rid of the spaces in grade = 0.1*homework + 0.3*quizzes + 0.6*tests part.
so grade = 0.1*homework+0.3*quizzes+0.6*tests


#6

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