An additional suggestion:
> =====
> # Add your functions below!
> def average(numbers):
> total = sum(numbers)
> total = total / len(numbers)
> return total
Don't re-assign total here. The problem is that conceptually "total" no
longer represents the total in the second assignment. It makes the name
meaningless.
One way to resolve the problem is to just return the value.
#################
def average(numbers):
total = sum(numbers)
return total / len(numbers)
#################
That is, the problem isn't one of computation, but of compassion. Help
make code readable.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor