python operator Ⅵ

Python member operator

In addition to some of the above operators, Python member also supports the operator, the test example http://www.xuanhe.net/ contains a series of members, including strings, lists or tuples.

 


Example (Python 2.0+)
The following example demonstrates the operation of all members Python operators:

 

Examples of the above output:

 

 

Python identity operator

Means for storing the identity of the operator to compare two objects

 


The following examples demonstrate the operation of the identity of all operators Python: Note:  ID ()  function is used to obtain the memory address of the object.

Example (Python 2.0+)

 

Examples of the above output:

 

 

Python operator precedence

The following table lists all the operators from highest to lowest priority:

 


Example (Python 2.0+)

The following examples demonstrate the Python all operator precedence operations:

 

Examples of the above output:

 

Guess you like

Origin www.cnblogs.com/danjiu/p/11401470.html