Hello guys! I'm trying to learn the basics of Python and am doing some exercise questions I have found online. I stumbled upon a question that I can't seem to understand how to do. I am not asking you to do the question for me, I just need some help on how to do it. However, if you love programming so much that you want to help me by making the code, feel free to do so.
Any help is appreciated! ***NOTE: I HAVE TO USE LOOPS***
Your parents need to buy a new vehicle and they are trying to decide whether to purchase a hybrid or not. Hybrid vehicles
produce less CO2 emissions and have better fuel efficiency
compared to their non-hybrid counterpart. However, hybrid
vehicles also cost a lot more money than their non-hybrid version.
Help your parents make a decision as to which type of vehicle to buy (strictly in terms of the financial cost and not taking into account the environmental
benefits). The typical family drives 20,000 kms each year and gas currently costs $1.30/litre.
Allow the user to enter the cost of the hybrid and non-hybrid vehicle along with the combined fuel efficiency of those vehicles. Also, allow the user to enter the average amount
of kilometers they drive each year (note: the average is 20000 km/year). Then output how many years of ownership it will take for the two cars to equal in cost. Assume that the price
of gas stays the same at $1.30/litre.
Obviously, the cost of gas will increase each year (this is called inflation). Perform
the same calculation for a level 3, but incorporate into your calculation the idea that gas
prices will rise by 3% each year (i.e. annual inflation rate is 3%).