essence/essence.py
2022-09-05 23:58:23 +02:00

21 lines
350 B
Python

#distance
distance = []
km = float(input("Distance parcourue (km) : "))
distance.append(km)
#litres
debit = []
L = float(input("Quantite d'essence consommee (L) : "))
debit.append(L)
#affichage_resultats
#(L/km)*100
for i in range(len(distance)) :
calc =(debit[i]/distance[i])*100
print(f"{calc:.3f} L/100km")