Complete the code to declare the Adapter class implementing the Target interface.
class Adapter([1]): def __init__(self, adaptee): self.adaptee = adaptee
The Adapter class must implement the Target interface to be used by the client.
Complete the Adapter method to call the adaptee's specific request.
def request(self): return self.adaptee.[1]()
The Adapter translates the Target's request() to the Adaptee's specific_request() method.
Fix the error in the client code to use the Adapter correctly.
adaptee = Adaptee()
adapter = [1](adaptee)
result = adapter.request()The client must create an Adapter instance passing the Adaptee to use the adapted interface.
Fill both blanks to complete the Adapter pattern class definitions.
class [1]: def specific_request(self): return "Adaptee behavior" class [2]: def request(self): pass
The Adaptee class has the specific_request method, and Target is the interface with request method.
Fill all three blanks to complete the Adapter's request method implementation.
class Adapter(Target): def __init__(self, adaptee): self.adaptee = adaptee def request(self): return self.adaptee.[1]() + ' adapted by ' + [2].[3]
The Adapter calls adaptee.specific_request() and appends the Adapter class name using self.__class__.__name__.