def variance(iterable, sample=False):
 a = (iterable if isinstance(iterable, list) else list(iterable))
 m = mean(a)
 return (sum((((x - m) ** 2) for x in a)) / ((len(a) - int(sample)) or 1))

def variance ( iterable , sample = False ) : a = ( iterable if isinstance ( iterable , list ) else list ( iterable ) ) m = mean ( a ) return ( sum ( ( ( ( x - m ) ** 2 ) for x in a ) ) / ( ( len ( a ) - int ( sample ) ) or 1 ) )
returns the variance of the given list of values .