zoukankan      html  css  js  c++  java
  • python_17_数据运算

    #//取整除,返回商的整数部分
    print(9//2)
    print(10/3.3)
    print(10//3.0)
    #<>与!=都为不等于
    #and 与    例(a and b)
    #or 或
    #not非
    #in  ,not in判断在与不在
    a=[1,2,3,4]
    if 1 not in a:print("sdfdsf")
    if 31 not in a:print('qwert')
    #is      is not
    b=[1,2,3,4]
    print(type(a) is list)
    print(type('333') is int)
    #   ^按位异或   ~按位取反
    m=40      #40=00101000
    n=33      #33=00100001
    print(m^n)#9= 00001001
    print(~m)#215= 11010111,-41=215-256
    #  <<左移,左移1位相当于乘以2,左移2位相当于乘以4   >>右移,右移1位相当于除以2,右移2位相当于除以4
    print(64<<1,64<<2)
    print(64*2,64*4)
    
    print(64>>1,64>>2)
    print(64/2,64/4)
    

      

  • 相关阅读:
    MFC列表控件更改一行的字体颜色
    MFC之sqlite
    MFC笔记10
    MFC---关于string.h相关函数
    MFC笔记8
    MFC笔记7
    MFC笔记6
    MFC笔记5
    MFC笔记4
    MFC笔记3
  • 原文地址:https://www.cnblogs.com/tianqizhi/p/8182199.html
Copyright © 2011-2022 走看看