Level 03: condition controlled repetitions 0 of 9 activities solved
  1. 1. Capital city Not yet solved
  2. 2. Car value Not yet solved
  3. 3. Adder Not yet solved
  4. 4. Compound interest Not yet solved
  5. 5. Valid month Not yet solved
  6. 6. Cashpoint Not yet solved
  7. 7. Square root Not yet solved
  8. 8. PIN Not yet solved
  9. 9. Measurements Not yet solved
Next series Assessment point: levels 01-03
Level 03: condition controlled repetitions

2. Car value

Sign in to hand in your solution and get feedback.

# Car value program # ------------------------- # Subprograms # ------------------------- def show_value(value, resale_value): year = 0 depreciation = 0.25 while value >= resale_value and resale_value > 0: print("In year", year, "the car is worth £", value) value = int(value - (value * depreciation)) year = year + 1 print("Part exchange before the end of year", year) # ------------------------- # Main program # ------------------------- value = int(input("Enter the value of the car purchased: £")) resale_value = int(input("Enter the minimum part exchange value: £")) show_value(value, resale_value)