Return not in function. Why?


def get_class_average(students):
for student in student:
return average(results)

File "python", line 51
SyntaxError: 'return' outside function

Anyone know what I'm doing wrong?


As we can see, it is not in the function since it does not match the indentation of the function block.

This statement is not in the function, either.


Ok, I see now. Having another problem now, will give it another crack. Thanks.


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