Indentation error - Stuck with codeacademies bizarre submission checker


#1

https://www.codecademy.com/courses/learn-python/lessons/student-becomes-the-teacher/exercises/part-of-the-whole?action=lesson_resume&link_content_target=interstitial_lesson

<In what way does your code behave incorrectly? Include ALL error messages.>
File “python”, line 40
results = []
^
IndentationError: expected an indented block

<What do you expect to happen instead?>
Why is my program wrong? it shows indentation error when I have done the same kind of indentation as the solution code. I don’t get what codeacademy is expecting from me.




def get_class_average(class_list):
	results = []
for student in class_list:
  	results.append(get_average(student))
 return results[:len(student)]/len(student)  


#2
def get_class_average(class_list):
    results = []
    for student in class_list:
        results.append(get_average(student))
    return results[:len(student)]/len(student)  

Fixed indentation. Your for loop isn’t led by an indent.


#3

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