ch10_ex59_prof.py

Created by manuel-2de-indice2019

Created on October 14, 2019

506 Bytes


def quartile1_sol(n):
    q1 = n//4
    r = n%4
    if r == 0:
        return(q1)
    else:
        return(q1+1)

# Utlisation de la fonction
print(quartile1_sol(24))
print(quartile1_sol(25))
print(quartile1_sol(26))
print(quartile1_sol(27))


# Calcul de Q3
def quartile3(n):
    q3 = 3*n//4
    r = 3*n%4
    if r == 0:
        return(q3)
    else:
        return(q3+1)

# Utlisation de la fonction
print(quartile3(24))
print(quartile3(25))
print(quartile3(26))
print(quartile3(27))