zoukankan      html  css  js  c++  java
  • python学习之旅-02

    1、while 循环

    语法:

      while 条件:

        循环体

      else:

        当条件不成立时执行这里;  注意break直接退出,不会执行else部分

    break:终止当前循环

    continue:停止当前本次循环。 继续执行下一次循环

    2、格式化输出

    %s 占位符;占位字符串

    %d 占位数字

    3、运算符

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

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

    not  非真即假,非假即真

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

    or : if x == 0 then y else x

    and: 相反

    4、字符串编码
      1. ASCII 8bit 1byte
      2. GBK 16bit 2byte
      3. Unicode 32bit 4byte
      4. UTF-8 可变长度的unicode
      英文: 8bit 1byte
      欧洲文字; 16bit 2byte
      中文 :24bit 3byte

    5、in 和 not in
      in 判断xxx是否在xxx中..

  • 相关阅读:
    2020软件工程作业02
    2020软件工程作业01
    并发编程—协程
    并发编程—线程
    并发编程—进程
    python网络编程总结
    前端-Javascript
    前端-jQuery
    前端-CSS
    前端-Html
  • 原文地址:https://www.cnblogs.com/dandanouni/p/12530355.html
Copyright © 2011-2022 走看看