This variance function forgets to square the distances, so the positive and negative distances cancel and it always returns about 0. Fix line 4 so it squares each distance. It should print 5.0.
The break is on line 4 — but read the whole snippet first.