From 7edf327dc3473ef587c89b3aed2e0b67e353b9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kayra=20Ba=C5=9Far=20Karadeniz?= Date: Thu, 2 Apr 2026 12:40:22 +0300 Subject: [PATCH] =?UTF-8?q?shifted=5FKayra=5FBa=C5=9Far=5FKaradeniz.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week03/shifted_Kayra_Ba\305\237ar_Karadeniz.py" | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 "Week03/shifted_Kayra_Ba\305\237ar_Karadeniz.py" 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