Answer:
class Car:
def __init__(self):
self.model_year = 0
self.purchase_price = 0
self.current_value = 0
def calc_current_value(self, current_year):
self.current_value = round(self.purchase_price * (1 - 0.15) ** (current_year - self.model_year))
def print_info(self):
print("Car's information:")
print(" Model year:", self.model_year)
print(" Purchase price: ${:,}".format(self.purchase_price))
print(" Current value: ${:,}".format(self.current_value))
Step-by-step explanation:
The purchase_price attribute has been added to the init() method and that the print_info() method now formats the purchase price and current value with commas using the format() function.