My first challenge was understanding 'object' in python. From my prior knowledge taking CSC108, I understood there are different types of built-in classes in python such as int, str, list, and it's quiet reasonable to consider them to be objects. However, they are not the only type of objects in python. In fact, I was soon adapted to the idea that everything in python can be considered as objects.
Everything in python is an object and the class tool we use is like a function that generates objects of a particular kind, which is called the 'instance' of this class. The object generated by this particular class can contain not only data, but also functions that could be applied to it. To be more precise, the instance has both attributes and methods. When we define our own class, we must first decide what we want to be kept as data, and what methods we wish to design for those instances of this class.
Next, I would like to talk about my understanding in the relationship between oriented objects
The objects in python. group together data and functions inside the data.
No comments:
Post a Comment