import math

def mean_std(xs):
    """Return (mean, population standard deviation) of list xs."""
    n = len(xs)
    if n == 0:
        raise ValueError("Empty list")
    mean = sum(xs) / n
    var = sum((x - mean) ** 2 for x in xs) / n  # population variance
    std = math.sqrt(var)
    return (mean, std)

if __name__ == "__main__":
    print(mean_std([2,4,4,4,5,5,7,9]))
