Object-Oriented Programming is a fundamental programming paradigm based on the concepts of objects and classes that can perform certain operations through their methods. We'll get into more details about OOP in this notebook.
Note: For this notebook, one should have some understanding of objects and classes.
A class is more or less a blueprint of an object. A class defines all the attributes and methods a certain object can attain. For example, a class for a student could contain attributes such as name, date of birth, phone number etc. and also contain methods which could perform any desired operations on these attributes.
An important building block of the class is the class' constructor (i.e the __init__ method). This method is the default method called upon instantiation (creating an instance/object of that class) and is usually where we'll define our attributes..
Let us understand all the above through an example.
class
from Planet SciPy
read more
No comments:
Post a Comment