Python Class

Anatomy A python class is defined using the 'class' keyword followed by the class name and a colon.  Instance variables and methods will be defined as shown below with proper indentation. The constructor (__init__) and the destructor (__del__) are both optional. class Dog: x = 0 def __init__(self): print('Constructor executed') def __del__(self): print('Destructor executed') def