Python Function That Calculates The Variance