28 lines
505 B
Python
Executable File
28 lines
505 B
Python
Executable File
#!/usr/bin/python3
|
|
#Creation du tableau
|
|
|
|
i=0
|
|
tab=[]
|
|
total = 0
|
|
|
|
for i in range (5):
|
|
valeur = int(input("Entrez la valeur du tableau : "))
|
|
tab.append(valeur)
|
|
print(tab)
|
|
|
|
l = len(tab)
|
|
|
|
maxi = tab[0]
|
|
mini = tab[0]
|
|
moyenne = 0
|
|
|
|
for i in range (0,l):
|
|
if mini > tab[i]:
|
|
mini = tab[i]
|
|
if maxi < tab[i]:
|
|
maxi = tab[i]
|
|
total = tab[i]+total
|
|
moyenne = total /(i+1)
|
|
|
|
print("Le maximum : ", maxi,", le minimum : ", mini,", la moyenne : ", moyenne,", le total : ",total, ".")
|