subject

Write a class named car that has the following data attributes: __year_model (the car’s year model) __make (the make of the car) __speed (the car’s current speed) the car class should have an __init__ method that accept the car’s year model and make as arguments. these values should be assigned to the object’s __year_model and __make data attributes. it should also assign 0 to the __speed data attribute. the class should also have the following methods: accelerate - the accelerate method should add 5 to the speed data attribute each time it is called. brake - the brake method should subtract 5 from the speed data attribute each time it is called. get_speed - the get_speed method should return the current speed.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:40, Kathryn014
You are working with a professional edition organization. they wish to install the expense tracker which requires the use of 4 custom tabs, 3 custom objects, and one custom app. if the company is already using 4 applications, 36 custom objects, and 7 custom tabs, what will happen when they try to install expense tracker?
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, natalie2sheffield
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
image
Computers and Technology, 23.06.2019 09:00, jeremytheprimerapper
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
You know the right answer?
Write a class named car that has the following data attributes: __year_model (the car’s year model)...

Questions in other subjects:

Konu
English, 09.12.2020 21:10
Konu
Mathematics, 09.12.2020 21:10