Variables du constructeur Python

class DemoClass:
    num = 101 # default value of self.num when read_number method called

    # parameterized constructor
    def __init__(self, data):
        self.num = data

    # a method
    def read_number(self):
        print(self.num)
Shy Sandpiper