Python Objects and classes

Source: Internet
Author: User
#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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.