Object-oriented programming of Python

Source: Internet
Author: User

Before we know about object-oriented programming, we need to know what object-oriented is. It can be said in general that all things in the world are objects, and since they are objects, different objects have different properties. However, objects with the same or similar attributes can be grouped together and sorted. So we can also say that everything in the world can be categorized. And as long as the object, it must belong to a category, there must be attributes.

Understanding the object-oriented, we next understand object-oriented programming (also known as OPP programming)

Object-oriented programming uses "classes" and "" objects to create various models to achieve a real-world description.

  

What are the benefits of object-oriented versus process-oriented programming? My understanding is that

1. Object-oriented partitioning of objects into a single class, with properties and methods in the class, we can write some of the repetitive code we use throughout our program as a method in a class that simplifies the code and makes your code look concise (and Python's philosophy).

2. After our code is written out, it is not used once to throw away, but can be reused, since it can be used repeatedly, then we need to change repeatedly, here

Object-oriented programming of Python

Related Article

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.