Complete the code to define a Null Object class that implements the same interface.
class NullLogger: def log(self, message): [1]
The Null Object's method should do nothing, so pass is correct.
Complete the code to use the Null Object pattern to avoid null checks.
def process(logger): logger.[1]('Start processing')
The method to call on the logger is log as defined in the interface.
Fix the error in the Null Object implementation to correctly override the interface method.
class NullNotifier: def notify(self): [1]
The Null Object should override the method and do nothing, so pass is correct.
Fill both blanks to complete the factory method that returns a Null Object when input is None.
def get_logger(logger): if logger is None: return [1]() else: return [2]
If logger is None, return an instance of NullLogger, else return the given logger.
Fill all three blanks to implement a Null Object pattern with a dictionary comprehension filtering active users.
active_users = {user: [1] for user, status in users.items() if status [2] 'active' and user != [3]Assign NullNotifier() as the value, filter users where status is 'active', and exclude users equal to None.
