# imports from random import seed, random # fonctions def listAleatoireFloat(n): """Retourne une liste de <n> flottants aleatoires.""" return [random() for i in range(n)] # programme principal n = int(input("Entrez un entier [2 .. 100] : ")) while not (2 <= n <= 100): # saisie filtree n = int(input("Entrez un entier [2 .. 100], s.v.p. : ")) seed() # initialise le generateur de nombres aleatoires t = listAleatoireFloat(n) # construction de la liste print("Liste :", t) print("Amplitude : {:.2f}".format(max(t) - min(t))) print("Moyenne : {:.2f}".format(sum(t)/n))