I triggered an error for the problem child Alice as well. Oops, try again. get_class_average([alice]) should return a number. I only wrote enough code to define the def get_class_average(students): and results = . I couldnt ever shake Alice even when just checking for indentation.
i shook the alice error. Now I have a syntax error. The chevron points to the return but I have return directly under for in a for block statement. Typed and re-typed. Not sure what is invalid about return.
SyntaxError: invalid syntax
total = sum(numbers)
total = float(total)
result = total/len(numbers)
homework = average(student[“homework”])
quizzes = average(student[“quizzes”])
tests = average(student[“tests”])
return 0.1homework + 0.3quizzes +
result = get_average(lloyd)
results = 
for student in students:
res = get_average(student)
#this is the working code in the most simpified form…Thank you
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.