How the "def match(self, example)" method is automatically calling and how the example arguments is working here? trainung_data = [
    ['Green', 3, 'Apple'],
    ['Yellow', 3, 'Apple'],
    ['Red', 1, 'Grape'],
    ['Red', 1, 'Grape'],
    ['Yellow', 3, 'Lemon'],
]
header = ["color", "diameter", "label"]
def is_numeric(value):
    return isinstance(value, int) or isinstance(value, float)
class Question:   
    def __init__(self, column, value):
        self.column = column
        self.value = value

    def match(self, example):
        val = example[self.column]
        if is_numeric(val):
            return val&gt;=self.value
        else:
             return val&gt;=self.value
    def __repr__(self):
        condition = '=='
        if is_numeric(self.value):
            condition = '&gt;='
        return "Is %s %s %s?" % (header[self.column], condition, str(self.value))


Now if i call the class like:

Question(0, 'Green')


It give me output like this

Is color == Green?
Typing 

Question(0,'Green')


should not print out anything. However if you type 

print(Question(0,'Green'))


then, the $\_\_$repr$\_\_$ method is called.