find mean of a list of numbers wiki https en wikipedia orgwikimean mean3 6 9 12 15 18 21 12 0 mean5 10 15 20 25 30 35 20 0 mean1 2 3 4 5 6 7 8 4 5 mean traceback most recent call last valueerror list is empty find mean of a list of numbers wiki https en wikipedia org wiki mean mean 3 6 9 12 15 18 21 12 0 mean 5 10 15 20 25 30 35 20 0 mean 1 2 3 4 5 6 7 8 4 5 mean traceback most recent call last valueerror list is empty
from __future__ import annotations


def mean(nums: list) -> float:
    
    if not nums:
        raise ValueError("List is empty")
    return sum(nums) / len(nums)


if __name__ == "__main__":
    import doctest

    doctest.testmod()