python-day2

while 循环

  语法:

    while条件:

      循环体

    else:

      当条件不成立的时候执行这里 和break没关系

    判断条件是否成立,如果成立执行循环体,然后再次判断条件。。。。。。直到条件不成立的时候跳出循环格式化输出 %s

  %s 占位符,占位字符串

  %d 占位数字

运算符

  and 并且,左右两端同时为真,结果才能是真

  or 或者,左右两端有一个是真,结果就是真

  not 非真既假,非假既真

  优先级 : ()>  not  >  and  >  or  

  or : if x == 0 then y else x

  and : 相反

字符串编码

  1 ASCII  8bit  1byte

  2 GBK  16bit  2byte

  3 Unicode 32bit  4byte

  4 UTF-8  可变长度的unicode

    英文:8bit  1byte

    欧洲文字: 16bit  2byte

    中文:24bit  3byte

in 和 not in

  in 判断xxx是否在xxx中

原文地址:https://www.cnblogs.com/Thui/p/9810972.html