From ca3fa14f8208d917d301701c72177649c726593b Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Tue, 6 Sep 2022 12:06:56 +0200 Subject: [PATCH] Fix for multi line --- essence.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/essence.py b/essence.py index 9b34468..7d52b7d 100644 --- a/essence.py +++ b/essence.py @@ -2,42 +2,28 @@ 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 -j = 1 +j = 0 while (j < ticket) : - + km = float(input("Distance parcourue (km) : ")) distance.append(km) - + L = float(input("Quantite d'essence consommee (L) : ")) debit.append(L) j = j + 1 - + #affichage_resultats resultats = [] for i in range(len(distance)) : - calc = (debit[i]/distance[i])*100 + calc = (debit[i]/distance[i])*100 #print(f"{calc:.3f} L/100km") resultats.append(calc) - + #moyenne moyenne = sum(resultats)/len(resultats)