scripts python
This commit is contained in:
38
sio1/sisr1/70-python/tableau.py
Executable file
38
sio1/sisr1/70-python/tableau.py
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
min=int(0);
|
||||
max=int(0);
|
||||
i=int(0);
|
||||
tableau=[];
|
||||
moyenne=float(0);
|
||||
|
||||
nombre=int(input("Entrez un nombre entier : "));
|
||||
min=nombre;
|
||||
if nombre>max:
|
||||
max=nombre;
|
||||
tableau.append(nombre);
|
||||
|
||||
|
||||
for i in range(0,4):
|
||||
nombre=int(input("Entrez un nombre entier : "));
|
||||
|
||||
if nombre<min:
|
||||
min=nombre;
|
||||
|
||||
if max<nombre:
|
||||
max=nombre;
|
||||
|
||||
tableau.append(nombre);
|
||||
|
||||
for i in range(0,5):
|
||||
moyenne+=float(tableau[i]);
|
||||
|
||||
moyenne=float(moyenne/len(tableau));
|
||||
|
||||
for i in range(0,5):
|
||||
print(tableau[i]);
|
||||
|
||||
print("\nLe plus petit nombre est : ", min);
|
||||
print("Le nombre le plus grand est : ", max);
|
||||
print("La moyenne est de :", moyenne);
|
||||
|
||||
Reference in New Issue
Block a user