Question: how to calculate variance of list in python?
Answer: avg = sum(lst) / len(lst) var = sum((x-avg)**2 for x in lst) / len(lst) print(var) # 0.6666666666666666.