Fix Mutli Line #1

Merged
dari merged 1 commits from fix-mutli-line into master 2022-09-06 12:13:56 +02:00
Showing only changes of commit ca3fa14f82 - Show all commits

View File

@ -2,42 +2,28 @@
ticket = int(input("Nombre de tickets a evaluer : ")) ticket = int(input("Nombre de tickets a evaluer : "))
#distance
distance = []
km = float(input("Distance parcourue (km) : "))
distance.append(km)
#litres
debit = []
L = float(input("Quantite d'essence consommee (L) : "))
debit.append(L)
#plusieurs_donnees #plusieurs_donnees
j = 1 j = 0
while (j < ticket) : while (j < ticket) :
km = float(input("Distance parcourue (km) : ")) km = float(input("Distance parcourue (km) : "))
distance.append(km) distance.append(km)
L = float(input("Quantite d'essence consommee (L) : ")) L = float(input("Quantite d'essence consommee (L) : "))
debit.append(L) debit.append(L)
j = j + 1 j = j + 1
#affichage_resultats #affichage_resultats
resultats = [] resultats = []
for i in range(len(distance)) : for i in range(len(distance)) :
calc = (debit[i]/distance[i])*100 calc = (debit[i]/distance[i])*100
#print(f"{calc:.3f} L/100km") #print(f"{calc:.3f} L/100km")
resultats.append(calc) resultats.append(calc)
#moyenne #moyenne
moyenne = sum(resultats)/len(resultats) moyenne = sum(resultats)/len(resultats)