TP 11 exo2: avoid a function run at each for() loop iteration