Python-oriented oriented language Object Oriented Programming Language

Pytho is object-oriented programming language that whenever Literals values ​​are Object. E.g:

>>> id(38)
8791423739696

versus

>>> id('ABC')
34336360

Has a built-in pointing pointer pointing to this Object, i.e., each has a unique Object ID value, through which instructions to access this id Object. For example: position 38 is stored in the RAM Object This is 8791423739696, and the storage location 'ABC' in this string 34336360.

An interesting example of this phenomenon is the bottom:

>>> Number = 38
>>> id(Number)
8791423739696

When this 38 Assign to the variable integer Number, Number 38 and are directed through the same content id value to the value 8791423739696 38.

38, when it is proved that in Python execution environment, its position was determined, i.e., a computer 38 assigned to Allocate memory space in RAM, and the position of the address in the Memory Address is 8791423739696

When cognitive Python is fully oriented to the programming language Object-Oriented Programming Language, the programming of the subsequent application, go with the concept of OO design is necessary.

 

Guess you like

Origin www.cnblogs.com/chingchangmeng/p/11358960.html