subject

I need help with completing this python code. Complete the Car class by creating an attribute purchase_price (type int) and the method print_info() that outputs the car's information. Ex: If the input is:2011180002018where 2011 is the car's model year, 18000 is the purchase price, and 2018 is the current year, then print_info() outputs:Car's information: Model year: 2011 Purchase price: 18000 Current value: 5770Note: print_info() should use three spaces for indentation. class Car:def __init__(self):self. model_year = 0# TODO: Declare purchase_price attributeself. current_value = 0def calc_current_value(self, current_year):depreciation_rate = 0.15# Car depreciation formulacar_age = current_year - self. model_yearself. current_value = round(self. purchase_price * (1 - depreciation_rate) ** car_age)# TODO: Define print_info() method to output model_year, purchase_price, and current_valueif __name__ == "__main__":year = int(input())price = int(input())current_year = int(input())my_car = Car()my_car. model_year = yearmy_car. purchase_price = pricemy_car. calc_current_value(current_year)my_ car. print_info()

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:20
Quincy would like to view the contents of a specific message in his inbox. a portion of his computer screen is shown. what should quincy do in order to complete this task? 1. click on the inbox in the navigation pane, and click on the specific message in the folder pane to display its contents. 2. click on the inbox in the outlook today window, and click on the specific message in the folder pane to display its contents. 3. double-click the message’s header in the outlook today window, and right-click on the specific message to display its contents. 4. double-click the mail option in the navigation pane, and right-click on the specific message to display its contents.
Answers: 1
question
Computers and Technology, 21.06.2019 23:00
Fast sportcars the top speeds of sportscars, given in miles per hour, are: 155 mph bmw m5 217 mph lamborghini aventador spyder 205 mph ferrari 488 205 mph nissan gtr 197 mph chevrolet corvette stingray zr1 258 mph bugatti veyron supersport 195 mph dodge viper 270 mph hennessey venom 155 mph bmw m3 195 mph mercedes sl given: topspeeds=[155; 217; 205; 205; 197; 258; 195; 270; 155; 195]; carnames=string(["bmw m5" "lamborghini aventador spyder" "ferrari 488" "nissan gtr" "chevrolet corvette stingray zr1" "bugatti veyron supersport" "dodge viper" "hennessey venom" "bmw m3" "mercedes sl"]); the variable is a rectangular array. write a function called selectcars to identify cars with the top speed within a given range, and display the identified names. the selected cars speed will be in a range given by lowerbound < speed < upperbound. inputs to the function selectcars are: a column array os all car top speeds named topspeeds, the corresponding chara
Answers: 2
question
Computers and Technology, 23.06.2019 13:00
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
You know the right answer?
I need help with completing this python code. Complete the Car class by creating an attribute purcha...
Questions
question
Mathematics, 05.05.2020 11:55
question
Mathematics, 05.05.2020 11:55
question
Mathematics, 05.05.2020 11:55
Questions on the website: 13722363