scripts python

This commit is contained in:
root
2022-09-28 17:24:40 +02:00
parent d04439cb70
commit ba69fb4a2c
4 changed files with 59 additions and 0 deletions

38
sio1/sisr1/70-python/tableau.py Executable file
View 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);