Find the median and the quarts parts of a statistic sequence in #pythonprogramming: a thread 1/ First write an median function which find the half indice of a list using n = len(list) (lenght of list) means (n-1)/2 if n is odd and between n/2 - 1 and n/2 if n is even.
In this function, we particularly use % for design arithmetic rest and int operator to convert float to integer. NB: we suppose that at the beginning, list is range by increase order. 2/ Afterwards we define a new function using same logic, but in more take an list of notes,
create a new list knowing that value of first list list[i] design students number who have been the note i. And send the median of the new list.
NB: we use concatenate in the mediane_notes at the line b = b + (effectif_notes[i]*[i]) to add [i] effectif_notes[i] times to list b.
3/ And the last function calcule_quartiles(liste) which give (using precedent median function ) to give the series quarts: Q1 (median of the first list half), Q3(median of the second list half), abd Q2 (median of all the list).
NB: we use list[0:j] which design all the elements