Compare commits
No commits in common. "a2222f928261418d94c3bcc082fcf39a085bc90a" and "46829ccbee635caa54bcde7e5474d044adc3f2e8" have entirely different histories.
a2222f9282
...
46829ccbee
26
essence.py
26
essence.py
@ -2,28 +2,42 @@
|
||||
|
||||
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 = 0
|
||||
j = 1
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user