Complete the code to define the Elevator class with a constructor.
class Elevator: def __init__(self, [1]): self.current_floor = 0 self.requests = []
The Elevator class constructor should take an identifier id to distinguish elevators.
Complete the code to add a method that adds a floor request to the elevator.
class Elevator: def add_request(self, [1]): self.requests.append(request)
The method should accept a request object to add to the requests list.
Fix the error in the Floor class constructor parameter name.
class Floor: def __init__(self, [1]): self.number = number self.waiting_requests = []
The parameter name should be number to match the assignment self.number = number.
Fill both blanks to complete the Request class with source and destination floors.
class Request: def __init__(self, [1], [2]): self.source = source self.destination = destination
The constructor parameters should be source and destination to match the assignments.
Fill all three blanks to create a method that checks if the elevator is idle (no requests and at floor 0).
class Elevator: def is_idle(self): return len(self.[1]) == 0 and self.[2] == [3]
The method checks if requests list is empty and current_floor is 0.
