HOME/Articles/

python code find average list of numbers (snippet)

Article Outline

Python example 'python code find average list of numbers'

Functions in program:

  • def average(*args):

python code find average list of numbers

Python code example: python code find average list of numbers


#Find the average of a list of numbers

def average(*args):
    return sum(args, 0.0) / len(args)
average(5, 8, 2)

More Python: https://pythonprogramminglanguage.com