Source: https://prof.math.free.fr/seconde/documents/TP1_Python.pdf