lines 3-9 is the
on lines 4-9 they initialize some class attributes. Note that although normally you would inirialize some if not all attributes in __init__(), it's not mandatory that all attributes are initializaed in
__init__()
functions. That is one of the number of special methods, so called dunders (from double underscore) functions that can be used to customize class.__init__()
is called at time of class instantiation (i.e. every time when you create an instance of the class).on lines 4-9 they initialize some class attributes. Note that although normally you would inirialize some if not all attributes in __init__(), it's not mandatory that all attributes are initializaed in
__init__()
. actually it's not mandatory to have __init__()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs