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.