Skip to main content
3 of 4
added 308 characters in body
Anshul Goyal
  • 78k
  • 42
  • 162
  • 196
  1. You are incorrectly using the *= and += statements.
  2. You can't use the taxes *=0.06 statement unless you have defined taxes previously. Same is the case with licence and premium_pack.
  3. Also, the statement float(input(taxes)) is wrong, you need to pass a string as an argument to it. (http://docs.python.org/3/library/functions.html#input)
  4. Next, if you are using python 2.7, the usage of the input statement is incorrect - you should use raw_input instead. (http://stackoverflow.com/a/3800862/1860929)
  5. There is an extra closing bracket in print("\n\total price:", total_price)) statement
  6. You are using an extra \ after \n due to which, the t of total will get escaped.
  7. Finally, you need to check the logic itself. As @Wayne has pointed in his answer, you probably want to do taxes = base_price * 0.06 and not taxes = taxes * 0.06

Check the following code, I think you are looking for something similar

base_price = float(raw_input("Please enter base price of car",)) taxes = 0.06 * base_price print("Taxes: %s" %taxes) licence = 0.01 * base_price print("Licence: %s" %licence) premium_pack = 1250 print("premium pack: 1250") total_price = base_price + premium_pack + taxes + licence print("\ntotal price: %s" %total_price) raw_input("\n\npress enter key to exit") 
Anshul Goyal
  • 78k
  • 42
  • 162
  • 196