Part of Code


#1

I don’t understand, what’s wrong with this code:

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

I try to calculate the class average.(Student Becomes the Teacher
Part of the Whole)

Could you help me?


#2

you mean you could find no similar topics:

which covers your return indent problem? took me less then a minute to find under students become teachers track which you are currently at

The other issues, which you indeed see less common is that .append() modifies the list and returns None. So currently, you store None in results variable, overwriting your list with None

please next time post your code with format:

so indent shows (Quit useful when a indent issue needs debugging)


#3

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