Source: https://pc.fermat.free.fr/Python/TP1-c.pdf