Created
November 1, 2014 19:55
-
-
Save pbondoer/5e29b647d3d629817417 to your computer and use it in GitHub Desktop.
DM ISN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
print("Nous avons pris 100 nombres au hazard.") | |
#generer une liste de 100 nombres entiers compris entre 0 et 100 | |
n = [] | |
for i in range(0, 100): | |
n.append(randint(0, 100)) | |
#ordonner la liste de maniere croissante | |
n = sorted(n) | |
#donner le maximum, le minimum et la moyenne | |
print("La liste est") | |
print(str(n)) | |
print("Maximum:", max(n)) | |
print("Minimum:", min(n)) | |
print("Moyenne:", float(sum(n)/len(n))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment