Record the python learning process with caution and record the python Process

Source: Internet
Author: User

Record the python learning process with caution and record the python Process

1. Everything in python is an object, and the built-in data structure is also an object. To process an object, you can use its methods and attributes to process the object and achieve the desired result step by step.

2. During programming, we first plan what the objects we are dealing with, what attributes and methods we have, and what objects our output results are.

3. in python, quotation marks (''or" ") represent strings, square brackets ([]) represent lists, curly brackets ({}) represent dictionaries, and parentheses () represent tuples, A number represents an integer or floating point number, and a string (such as name) without quotation marks represents a variable. In fact, these symbols are similar to the form of custom classes. For example, to customize a Persion class, when the Persion (parameter) is used, the class is instantiated. The 'parameter' or [parameter] also indicates instantiating the string and List classes respectively.

4. built-in functions (written in C) are not applicable to all objects in python. For example, the list function can be used to iterate objects.

5. Functions and classes are actually processing input parameter objects to get the desired results. Inside a class, you can use the input parameter, that is, the object (a class) method to process the parameter.

6. Use python's built-in data structures, methods, and other built-in functions to build more functions and custom classes.

7. function: function parameters can be custom classes, attributes can be custom class objects, and return can also be custom classes. Do not think that only the string class is supported. As long as the class definition is imported into the Code, if the custom class object is not imported, a NameError will be generated, indicating that the variable is not defined and cannot be called.

8. python is a dynamic language (duck). It does not care about the type of the object you pass in. An error is reported only when properties or methods are not found when you call the object attributes and methods.

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.