From 3be26c1aeda8f786824b1cf491d0577436d48bdb Mon Sep 17 00:00:00 2001 From: Nikolas <147613528+stamatisn@users.noreply.github.com> Date: Fri, 27 Dec 2024 18:07:23 +0200 Subject: [PATCH] Trip cost This is a very simple program to calculate the fuel cost of the trip you just made. The user writes the kilimeters, the usage pre kilometer of the car and the price of the fuel. Then the program calculates the total cost of the fuel for the whole trip --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..62d9f52 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +def Trip (): + km = float (input ("Type the distance in km: ")) + lpkm = float (input ("Type the liters per kilometer usage by the car: ")) + ppl = float (input ("Type the price per liter: ")) + + total_cost = km * lpkm * ppl + print (total_cost) + + + +def main(): + Trip() + +if __name__ == '__main__': + main() \ No newline at end of file