[Tutor] basic question

Najam Us Saqib ausnajm at yahoo.com.au
Fri Apr 5 14:05:40 CEST 2013


Hi,

My name is Najam, I am very new to Python Programming. Would you please help me with the following question?

The question/problem is,

Write a Car salesman program where the user enters the base price of a car. The program should add a bunch of extra fees such as tax, license, dealer prep, and destination charge.Make tax and license a percent of the base price. The other fees should be set values. Display the actual price of the car once all the extras are applied.

I am not sure whether I have entered the right code for "Make tax and license a percent of the base price." or not.

My program is;

price = float(raw_input("Enter the base price of the car $ "))

tax = float(raw_input("Enter the tax $ "))
licence = float(raw_input("Enter the licence fees $ "))
dealer_prep = float(raw_input("Enter the dealer prep fees $ "))
des_charge = float(raw_input("Enter the destination charge $ "))

percent = (tax * 0.01 + licence * 0.01) / price                                   # ?????

print "\nA percent of the base price is: $ " , percent

total = price + tax + licence + dealer_prep + des_charge

print "\nThe actual price of the car is: $ " , total

raw_input("\nPress Enter key to Exit, thank you.")



Thank you.
Najam.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130405/59b820ca/attachment.html>


More information about the Tutor mailing list