From 165200aadd7ab366e93d22dd1087b369ccd9b6bd Mon Sep 17 00:00:00 2001 From: Jean-Loup Beaussart Date: Tue, 10 Mar 2015 11:22:40 +0100 Subject: [PATCH] fonction tri_et_compte --- S2/TP4/analyse_tris.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/S2/TP4/analyse_tris.py b/S2/TP4/analyse_tris.py index 3f0d643..88c6670 100644 --- a/S2/TP4/analyse_tris.py +++ b/S2/TP4/analyse_tris.py @@ -101,6 +101,16 @@ question(1) question(2) +def tri_et_compte(foo, l): + + assert(type(l)==list) + + global compteur + + compteur = 0 + + return (foo(l), compteur) + partie("Analyse du tri par sélection") question(1)