day02格式化输出等

1.格式化输出
    format % 占位符
    %s:str, %d: dight, %f: float
    字符串多行用三个单引号或三个双引号
    %%5,百分之五,转义字符%。想要在格式化输出中加一个%,就要在%前加一个%
2.while......else..........
    当while循环语句没有被break打断时,执行else语句
    while语句没有被break语句打断,循环结束后,执行else语句
3.编码
    历史:ascii码->unicode->utf-8
    运算:
    8bit=1byte
    1024bytes=1kb
    1024kb=1mb
    1024mb=1gb
    1024gb=1tb
4.运算符
    数学运算符
    赋值运算符
    比较运算符
    逻辑运算符
        and, or, not
        1)优先级 ()>not>and>or
        2)数字和布尔值的转换
            bool(非0数字) = True
            bool(0) = False
            int(True) = 1
            int(False) = 0
        3)数字用or或and链接
            x,y :x为True,返回x
            x,y  : x为False,返回y
            and 与 or 相反
posted @ 2019-04-28 21:30  市丸银  阅读(140)  评论(0编辑  收藏  举报