Skip to content

Commit a12880f

Browse files
authored
Merge pull request #125 from kilic-mustafa/patch-2
Create shifted_mustafa_kilic.py
2 parents d0ccf6a + 4f1b3ec commit a12880f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Week05/shifted_mustafa_kilic.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import statistics
2+
3+
def shifted(data):
4+
if not data:
5+
return None
6+
mean = statistics.mean(data)
7+
median = statistics.median(data)
8+
return 0 if median == 0 else abs(mean - median) / abs(mean) * 100

0 commit comments

Comments
 (0)