A Person will have the attributes: name, age, height, weight, gender, job. self.name for example, is then assigned “name” which will actually be a name at object creation.Īt this point, we’ve defined a Person. We then assign these attributes to variables because they’ll contain data once a person object is created. That is, the actual Person object that’s being created. Self is pretty self explanatory (pun intended!). In the ()s we specify all of the attributes we want the Person object to be created with. Note the difference between defining the class and creating the object based on the class.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |