📜  python代码示例中的质量控制

📅  最后修改于: 2022-03-11 14:47:00.954000             🧑  作者: Mango

代码示例1
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