Skip to content

Commit 94329e7

Browse files
authored
Create Compute Variance
1 parent aa84d36 commit 94329e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

interview_query/Compute Variance

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def get_variance(test_list):
2+
3+
4+
m = sum(test_list)/len(test_list)
5+
6+
7+
s = 0
8+
for num in test_list:
9+
10+
s += (num - m)**2
11+
12+
return round(s/len(test_list),2)

0 commit comments

Comments
 (0)