Some design algorithms exercicies (14, 18, 19, 20) (with Python)