Challenge

Project 2 - Implement the Code for controlling the retraction and extension of Airplane’s landing gear

class LandingGear:

def __init__(self):

self.retracted = True

def retract(self):

if not self.retracted:

print("Landing gear already retracted")

else:

print("Retracting landing gear...")

# Code for physically retracting the landing gear

self.retracted = True

def extend(self):

if self.retracted:

print("Landing gear already extended")

else:

print("Extending landing gear...")

# Code for physically extending the landing gear

self.retracted = False

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.