Solution 1

def get_average(list_of_numbers):
    total = 0
    for num in list_of_numbers:
        total += num
    return total / len(list_of_numbers)

Get Average

Complete the function get_average so that it returns the average of all the numbers
in list_of_numbers.

You'll need to use a for loop to calculate the total value of all the numbers added together.

Then divide the total by the amount of items in your list to get your average.

Hint: You'll need a variable to keep track of the total. You need to figure out whether that variable
belongs inside or outside the for loop.

Test Cases

test get average - Run Test

def test_get_average():
    assert get_average([5, 10, 6]) == 7
def get_average(list_of_numbers): pass