day02-python

1、while循环进阶
breake:终止当前循环。
continue:跳出本次循环,继续下次循环。
while else
while 嵌套

2、格式化
%s 占字符串位置(万能)
%d 占整型位置
%% 转义成普通的%号
按照位置顺序进行填充,占位和填充必须一一对应。%s和%d必须小写
f -strings

3、运算符
算法运算符 + - * / //(整除) %(求余) **
比较运算符 > < >= <= !=
赋值运算符 = += -= *= /= //= %= **=
逻辑运算符 and or not
and都为真时才是真
and都为真时选择and右边的内容
and都为假时选择and左边的内容
or 一个为真就是真
or都为真时选择or左边的内容
or都为假时选择or右边的内容
优先级
()> not >and >or
计算顺序
从左到右
成员运算
in
|

posted @ 2022-03-05 22:05  laity_guan  阅读(14)  评论(0编辑  收藏  举报