Average of numbers

Write a function named average_numbers that takes a positive integer n as input and returns the average of all integers from 1 to n, inclusive. Use a for loop.

Complete the supplied function in Listing 1. Keep its signature and use the checks below it.

Listing 1: Starter function and supplied checks for average of numbers.
def average_numbers(n: int) -> float:
    # Add code here!
    pass


assert average_numbers(5) == 3
assert average_numbers(10) == 5.5
assert average_numbers(1) == 1

range(start, stop) supplies integers beginning at start and ending before stop. For example, list(range(1, 4)) is [1, 2, 3]. An empty range supplies no values.

assert condition stops the check with an AssertionError when the condition is false.