#coding: Utf-8#1, an object is a collection of data with corresponding behavior, in object-oriented modeling, for various descriptive objects belonging to the distinction called Class # #, Class and object: Class describes the object, is the template to create the object # #, association is the most basic way to connect two classes, A class can be associated with any object in the other end of the relationship, and the number of objects in that class represents a multiplicity # Description of the Apple object's class-class apple:pass# description of the Orange object classes orange:pass# describes the class basket of the Basket object: Pass# describes bucket object classes class barrel:passif __name__ = = "__main__": #对象a1是Apple类的一个实例, can be correlated with each other A1 = Apple () #实例化 a2 = Apple () O1 = orange () O2 = Orange ()
Python Objects and classes