Question: Python project fly_drone.Add a Python file drone.py to this project.Define a class Drone in this file.This class has the following five methods: (a) __init__ :

Python project fly_drone.Add a Python file drone.py to this project.Define a class Drone in this file.This class has the following five methods:

(a) __init__ : Create two instance variables to store the speed and the height of the drone.Initialize them to 0.0. This method has no parameters other than self and no return value.

(b) accelerate : Increase the speed of the drone by 10.This method has no parameters other than self and no return value.

(c)decelerate : Decrease the speed of the drone by 10.The new speed cannot be negative.This method has no parameters other than self and no return value.

(d) ascend : Increase the height of the drone by 10.This method has no parameters other than self and no return value.

(e) descend : Decrease the height of the drone by 10.The new height cannot be negative.This method has no parameters other than self and no return value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!