Find Average

Beginner

Description

Welcome to the world of averages! In this challenge, you'll write a function that finds the average of a list of numbers. It's like finding the "middle" number, but instead, you add them all together and then divide by how many numbers there are.

For example, if we have the numbers [1, 2, 3, 4, 5], the sum is 1 + 2 + 3 + 4 + 5 = 15. Since there are 5 numbers, the average is 15 / 5 = 3. Easy peasy!

Your mission, should you choose to accept it, is to write a function called find_average that takes a list of numbers as an argument and returns the average of those numbers. Remember, don't print anything; just return the result!

Here's how your function should work:

find_average([10, 20, 30]) # returns 20.0 find_average([5, 7, 11]) # returns 7.666666666666667 find_average([3, 3, 3]) # returns 3.0 find_average([1]) # returns 1.0

Challenge:

  • Write a function find_average that returns the average of a list of numbers.
  • Your function should handle any list length greater than 0.

Have fun with numbers and good luck!

Geek
Inputs

Arg 1:

[10,20,30]
Expected Output
20.0
Actual Output