You are viewing a single comment's thread. Return to all comments →
Simple and sweet python solution
import statistics as s def quartiles(n,arr): arr.sort() m = int(n/2) a = int(s.median(arr[:m])) b = arr[m] c = int(s.median(arr[m+1:])) if n%2 == 0: return print(f"{a}\n{b-1}\n{c-1}") else: return print(f"{a}\n{b}\n{c}")
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Quartiles
You are viewing a single comment's thread. Return to all comments →
Simple and sweet python solution