Study notes (2): Zero-base mastering Python entry to actual combat-where does a dot go (1)

Learn now: https://edu.csdn.net/course/play/26676/338762?utm_source=blogtoedu

The essence of object-oriented programming is to determine how or what to do with this object according to specific scene conditions and object properties and methods.

Python built-in object types: integers, floating-point numbers; strings; lists; tuples; dictionaries; collections.

Variables cannot be defined individually in python. The variable must be attached to an object. In python, an object can establish a relationship with multiple variables. For example, 3 is an object, and a=3 associates the variable a with the object 3. In the same way, b=3 is the same. These operations can happen simultaneously. We generally call the relationship established in this way a reference relationship. In this relationship, the variable is like a label, which can be affixed to any object. It can make some operations simple and convenient, for example: we assign a to 3 and b to 4, we can exchange the corresponding relations through the following statement:'a, b=b, a'

 

Guess you like

Origin blog.csdn.net/Bernze/article/details/109187824