diff --git "a/Week03/shifted_Kayra_Ba\305\237ar_Karadeniz.py" "b/Week03/shifted_Kayra_Ba\305\237ar_Karadeniz.py" new file mode 100644 index 00000000..fd7f8bcf --- /dev/null +++ "b/Week03/shifted_Kayra_Ba\305\237ar_Karadeniz.py" @@ -0,0 +1,8 @@ +def shifted(sample): + x, y = sorted(sample), len(sample) + mn = sum(x) / y + if y % 2 != 0: + md = x[y // 2] + else: + md = (x[y // 2 - 1] + x[y // 2]) / 2 + return abs(mn - md) / abs(mn) * 100 if mn != 0 else 0