Source: https://www.lamsade.dauphine.fr/~manouvri/PYTHON/TPPython.pdf