zoukankan      html  css  js  c++  java
  • Python while循环、逻辑运算、编码

    while循环
    语法:
    while 条件:
    循环体
    else:
    当条件不成立的时候执行这里 和break没关系
    判断条件是否成立。 如果成立执行循环体。然后再次判断条件,。。。。。直到条件不成立的时候跳出循环
    break 终止当前循环
    continue 停止当前本次循环。 继续执行下一次循环

    格式化输出 %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中..

  • 相关阅读:
    存储过程
    sdsdsd
    sdsdd
    sdsd
    sdasd
    mysql触发
    c#连接mysql答题步骤
    c#mysql数据库
    nginx
    linux如何查看端口被何进程占用
  • 原文地址:https://www.cnblogs.com/chcj/p/9813350.html
Copyright © 2011-2022 走看看