From c396581361c788e8774338b5cbcf3b8322363500 Mon Sep 17 00:00:00 2001 From: Fadoras Dariane Date: Mon, 5 Sep 2022 23:58:23 +0200 Subject: [PATCH] First commit --- essence.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 essence.py diff --git a/essence.py b/essence.py new file mode 100644 index 0000000..2b7b1d6 --- /dev/null +++ b/essence.py @@ -0,0 +1,20 @@ +#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")