def avarage(numbers):

total = float(sum(numbers))

n= total/float(len(numbers))

return n

# Its okay to be avarage

**seankunakam**#1

**mtf**#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.

**mtf**#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.

**seankunakam**#5

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

everything is indented besides the def bit

**system**#7

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