"Python automation Sixth article: Object-oriented"

Source: Internet
Author: User
Tags object object

Overview of Knowledge Points:

    1. Object-Oriented Introduction
    2. Object-oriented attribute (Class,object) instance variable, class variable
    3. Introduction to the programming of face object
    4. Private methods, private properties

First, object-oriented introduction

Programming Paradigm: Object-oriented, process-oriented, functional programming

    • Process oriented: Tell the machine what to do with a set of instructions; a process consists of a set of steps to be computed, the order of execution from start to finish, and the change of the program to pay attention to the dependencies of each part, otherwise it will affect the operation of other processes, a series of effects, maintenance difficulties.
    • Object-oriented: OOP programming is the use of classes and objects to create a variety of models to achieve a real-world description; The reason for using object-oriented programming is that it makes maintenance and expansion of programs easier and improves development efficiency. Makes the code clearer and easier to understand.
        • All things in the world can be classified, and all things are objects.
        • Just say: The object belongs to a certain kind of
        • As long as the object, there must be attributes

Second, Characteristics:

    • Class: An abstraction, blueprint, and prototype of an object that has the same attributes as an alien. In this class, you define the properties and common methods that these objects have.
    • Object object: An instance of a class that is instantiated after it has to be instantiated before it can be called in a program

Three main features:

    • Encapsulation: Assigning values to data in a class, internal calls are transparent to external users, which makes the class A capsule or container in which the data and methods of the class are contained.
    • Inheritance: A class can derive from Thunder, in this Inveraray defined property, method automatic Quilt class inheritance
    • Polymorphism: In simple terms, "there is an interface, a variety of implementations," refers to a base class derived from a different subclass, and each subclass inherits the same method name, but also the method of the parent class to make a different implementation, this is the same food shows a variety of forms

        

"Python automation Sixth article: Object-oriented"

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.