From 1b00b308cc82d74d8073d4970beedccd162aac63 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 10 Mar 2015 10:52:14 +0100 Subject: [PATCH] TP4 liste_alea() --- 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 a2e9e07..3f09a4d 100644 --- a/S2/TP4/analyse_tris.py +++ b/S2/TP4/analyse_tris.py @@ -36,6 +36,16 @@ partie("Travail à réaliser") section("Préliminaires") +def liste_alea(n, a, b): + """ + int, int, int → list + """ + res = [] + for i in range(n): + res.append(randint(a, b)) + return res + + question(0) question(0)