Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Quality Control in python

def average(values):
    """Computes the arithmetic mean of a list of numbers.

    >>> print(average([20, 30, 70]))
    40.0
    """
    return sum(values) / len(values)

import doctest
doctest.testmod()   # automatically validate the embedded tests
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #Quality #Control #python
ADD COMMENT
Topic
Name
4+3 =