Python basic data type int

Int int

Assignment Operators

a=1

a+=1    #a=a+1

a-=1    #a=a-1

a*=1    #a=a*1

a/=1    #a=a/1

a**=1   #a=a**1

a%=1    #a=a%1

Arithmetic operators

+ - * /     #加减乘除
**          #幂      2**4    二的四次方
//          #整除
%           #取余     

Logical Operators

()>not>and>or

And computing and, both sides are true, and take back the content

Both sides are false, content and take the front

and     #与      #两边都是真的时候才是真,一边是假就是假    

Or OR operation, when both are false, or take back the

Both sides are true when taken in front of or content

or      #或      #只要有一个是真就取真
        #一真一假输出真

Non-not

not     #非

Member operator

in the absence not in

Comparison Operators

等于 ==           判断两边的值是否相同
不等于 !=
大于  >
小于  <
大于等于    >=
小于等于    <=

Identity operation

It is is

It is not not

Guess you like

Origin www.cnblogs.com/llwwhh/p/11317950.html