Its okay to be avarage


#1

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

need help its showing an error saying average not found


#2

The instructions actually walk us through the steps, one by one, though you will have seen simplified versions on the forums.


def average(numbers):
    total = sum(numbers)            # first step in instructions
    total = float(total)            # second step
    total = total / len(numbers)    # third step
    return total

The idea is for us to gain some familiarity with the included concepts.

sum()     # function to add up a list of numbers
float()   # function to cast an integer to a float
len()     # function to query the length property of a list

See if you can make it work using the exact instructions, and once completed, then try reducing the amount of code as extra practice. Pass the lesson before deviating from the instructions where ever possible.


#3

l have done the same thing as you and it still says average not found


#4

Please post a link to this exercise, as well as the code you have so far. It will be most helpful if you format your code sample so we can see the indentation. Thanks.


#5

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

everything is indented besides the def bit


#6

Check your spelling... avarage => average


#7

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