OOP 4: Adding Methods

OOP 4: Adding Methods

4.1. Add the working_engine class attribute inside the Car class and assign it a value of False.

4.2. Add a start_engine method to the Car class, that displays the message "Engine has started" and changes the working_engine value of the instance of class to True.

4.3. Add a stop_engine method to the Car class, that displays the message "Engine has stopped" and changes the working_engine value of the instance of class to False.

4.4. Call the start_engine method for both instances some_car1, some_car2.