Need some help with "PART OF THE WHOLE"


#1

Here is my code:

Have a mistake: Oops, try again. get_class_average([alice]) resulted in an error: 'list' object has no attribute 'average'

Thank you.


#2

average() is a function call taking results as argument


#3

It works. thank you:)


#4

does it make sense why you do this?


#5

Sorry. I have some problems with English.
what do you mean?


#6

do you understand what you did?


#7

Yes, I did.
Because average is a function.

def average(numbers):
         total = sum(numbers)
         total = float(total) / len(numbers)
         return total

And "results" is a list which we send to "average" function
return average(results)
Am i right?
Sorry for awful English


#8

yes, very good :slight_smile: You understand


#9

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