Alerts

Report a typo

Below you can see a class hierarchy:

class Alert:
    def __init__(self, id):
        self.id = id

    def get_message(self):
        print("Alert {}".format(self.id))


class Warning(Alert):
    def get_message(self):
        print("Warning {}".format(self.id))


class Error(Alert):
    def get_message(self):
        print("Error {}".format(self.id))


class WarningError(Error, Warning):
    pass

Suppose, we create an instance of the class WarningError and call the get_message method. What will be the output?

warn_error8 = WarningError(8)
warn_error8.get_message()
Enter a short text
___

Create a free account to access the full topic