Learn 3: Create Your First Class

3. Variable Container Init()

Let’s show you how to do this with the simple test functions that you have written.

In the Variable Container Class cell we have created a basic class definition for you and called this our GlobalVariables class. It already contains some attribute definitions. These are attributes that will be set by the notebook’s template functions and buttons.

There is also an empty  __init__(self ) function definition. __init__(  ) is a special function, known as the constructor method. The code it contains is automatically run whenever an object of the class is instantiated. We do not need it but it's handy to see the print statement when we instantiate it.