python列表生成式内必须定义匿名函数_Python基础-----基础概念总结

Python基础-----基础概念总结

Python程序的构成

构成图

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

行连接符:\

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

对象基本构成和内存示意图

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

对象及其引用(变量)

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

标识符

基本用法

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

命名规则

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

变量和简单的赋值语句

变量声明必须初始化

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

删除变量和垃圾回收机制

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

链式复制

20200526170357255.png

系列解包赋值

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

常量(不支持)

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

最基本的内置数据类型

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

数字运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200526170932408.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

整数

20200526172648456.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

int()

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

整数缓存问题

20200526175244285.png

浮点数

20200526173214748.png

float() 和 round()

20200526174229961.png

增强型赋值运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

布尔值

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

比较运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

逻辑运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

同一运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

is与 == 区别

20200526175047344.png

字符串

字符串的基本特点

不可变

Python无单字符都是字符串

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字符串的编码

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

引用创建字符串

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

双引号可以包住单引号

三引号可以创建多个字符串(包住双引号)

空字符串和len()

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

转义字符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200526193222972.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字符串拼接

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字符串的复制

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

不换行打印

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

从控制台读取字符串

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

str()

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

[]来提取串中的字符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

replace()

20200526195355282.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字符串切片slice操作

2020052620075947.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

split()分割和join()合并

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200526204147271.png

字符串的驻留机制

20200526204841228.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字符串比较和同一性

20200526205340385.png

成员操作符(in和not in)

20200526205524810.png

字符串常用方法汇总

常用查找方法

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200526205836683.png

去除首尾信息

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

大小写转换

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

格式排版

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

其他方法

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字符串的格式化

format()基本用法

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

填充与对齐

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

数字格式化

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

可变字符串

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

运算符

基本运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

复合赋值运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200526213004717.png

控制语句

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

单分支选择结构

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

双分支选择结构

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

三元条件运算符

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

多分支选择结构

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

选择结构的嵌套

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

循环结构

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

while循环

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

for循环和可迭代对象遍历

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

可迭代对象

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

range对象

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

嵌套循环

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

break语句

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

continue语句

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

else语句

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

循环代码优化

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

使用zip()并行迭代

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

推导式创建序列

20200601222613542.png

列表推导式

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

字典推导式

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

2020060122341966.png

集合推导式

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

生成器推导式

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

函数

函数简介

函数的基本概念

20200601224144683.png

Python 的函数分类

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

函数的定义和调用

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

形参与实参

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

函数的注解

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

变量的作用域(全局变量和局部变量)

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

参数的传递

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

传递可变参数的引用

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

传递不可变参数的引用

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

浅拷贝和深拷贝

2020060320451891.png

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200603205742564.png

参数的集中类型

位置参数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

默认值参数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200603211844956.png

命名参数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

可变参数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

强制命名参数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

lambda表达式和匿名函数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

eval()

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200603213946323.png

递归函数

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

嵌套函数(内部函数)

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

nonlocal

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

20200603214755404.png

LEGB

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0F2ZXJ5MTIzMTIz,size_16,color_FFFFFF,t_70

原文链接:https://blog.csdn.net/Avery123123/article/details/106344222

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/551931.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

英语四级c语言,2017年大学英语四级精选试题练习

2017年大学英语四级精选试题练习勤奋和智慧是双胞胎,懒惰和愚蠢是亲兄弟。以下是小编为大家搜索整理的2017年大学英语四级精选试题练习,希望能给大家带来帮助!更多精彩内容请及时关注我们应届毕业生考试网!1、Courses with the numbers 800 or above are…

如何获取图像的驱动_Adobe Camera Raw 12 Mac(Raw格式图像ps插件) v12.2.1.417

Adobe Camera Raw 12 Mac版可以让摄影师在熟悉的Photoshop界面内打开并编辑这些RAW文件,极大的方便了摄影师的工作。Adobe Camera Raw 12 for Mac安装教程下载完成后,双击CameraRaw_12_2_1.pkg文件打开,根据安装器提示进行安装即可。安装完成…

centos usb转网口_CentOS5.6系统中安装并使用USB无线网卡(配置成功) 转

最近一直在配置linux服务器,因为家里装修的时候没有在墙面预留网络接口,所以我的台式机也使用无线网卡连接网络。在CentOS6.2下安装无线网卡的方法和CentOS5.6的方法是一样的,只是CentOS6.2下安装后,右上角会自动出现NetworkManag…

c语言中执行一次的函数once,iOS只执行一次的方法

IOS开发(64)之GCD任务最多只执行一次1 前言使用 dispatch_once 函数 在 APP 的生命周期内来保证你想确保每段代码只执行一次,即使它在代码的不同地方多次调用(比如单例的初始化)。2 代码实例ZYAppDelegate.m[plain]/一个用于调度一次函数的标识static dispatch_once_t onceToke…

python条件语句练习题_python学习-7 条件语句 while循环 + 练习题

1.死循环while 1 1:print(ok)结果是一直循环2.循环count 0while count < 10:print(count)count count 1print(error)3.练习题~ 使用while循环输出1 2 3 4 5 6 8 9 10count 1while count < 10 : # 或者count < 11if count 7:print( ) # 也可以添加pass&#xff…

c语言error ld returned,[Error] ld returned 1的错误

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼#include #include #include #include #include#define MAX 101#define N 1000#define M 250000/*函数功能&#xff1a;利用字符串实现超长数加减法运算 */void jianfa(int a[],int b[],int f);int lena,lenb,da1,db1; /* 把lena,l…

微信支持环信_环信客户互动云v5.39已发布:支持微信小程序接入

环信客户互动云v5.39_产品更新说明发布日期&#xff1a;2018-11-06客服模式质检中新增会话ID字段质检中新增会话ID字段&#xff0c;与历史会话中的会话ID对应&#xff0c;支持根据会话ID搜索质检会话&#xff0c;以及在质检详情中查看会话ID。便于质检员发现有问题的会话时&…

Android多线程优劣,Android 开发中用到的几个多线程解析

在开发工程中线程可以帮助我们提高运行速度&#xff0c;Android开发中我知道的线程有四个一个是老生长谈的Thread&#xff0c;第二个是asyncTask,第三个&#xff1a;TimetTask,第四个是Looper,四个多线程各有个的有点&#xff0c;Thread的运行速度是最快的&#xff0c;AsyncTas…

qc成果报告范例_QC推进这样做才是货真价值!| 看机电股份的QC报告

​❖QC小组活动是激发全体员工聪明才智、改善现场管理、提升企业综合竞争力的有效方法&#xff01;QC学习是QC活动推行的基础&#xff0c;高层参与则是QC活动推行的保障。-为进一步提升企业高层对QC的认识及重视&#xff0c; 5月20日下午&#xff0c;机电股份开展QC活动阶段汇报…

android白色字体代码,Android实现状态栏白底黑字效果示例代码

前言本文主要给大家介绍了关于Android如何实现状态栏白底黑字的相关内容&#xff0c;分享出来供大家参考学习&#xff0c;下面话不多说了&#xff0c;来一起看看详细的介绍吧。一、描述在项目中有的时候Ui设计状态栏背景颜色是白色的&#xff0c;虽然还挺好看&#xff0c;不过可…

ios 点生成线路 百度地图_iOS SDK | 百度地图API SDK

注意事项1、静态库中采用ObjectC实现&#xff0c;因此需要您保证您工程中至少有一个.mm后缀的源文件(您可以将任意一个.m后缀的文件改名为.mm)&#xff0c;或者在工程属性中指定编译方式&#xff0c;即在Xcode的Project -> Edit Active Target -> Build Setting 中找到 C…

android中文转字节数组,如何将Android中的byte []转换为C中的uint8_T数组?

Java没有无符号整数类型,但相机并不真正关心.您可以安全地将从onPictureTaken()回调到达的字节数组转换为uint8_t *.旁注&#xff1a;很可能,图片将以JPEG流形式到达.更新&#xff1a;在C中实现onPictureTaken()的示例以下是您在活动中的所在地&#xff1a;mCamera Camera.ope…

python代码没有反应_没有任何编程经验者不要被Python简明手册误导。

想学python,没有任何编程经验者不要被python简明手册误导。1、python简明手册是一本好书但这本书是针对有经验的程序员看的&#xff0c;详细一点说&#xff0c;有3年以上c/java&#xff0c;、delphi/vb&#xff0c;php等有丰富项目经验的程序员看的&#xff0c;他们一般一个星期…

android iphone对比度,对比度对比:显示器优势明显_苹果 MacBook Pro_液晶显示器评测-中关村在线...

紧接着&#xff0c;我们来看看对比度方面&#xff0c;戴尔P2412Hb液晶显示器以及华硕N53S、三星305V4A、神舟A560-i7D5优雅、联想B470e、富士通LH532、戴尔Inspiron 14R-7420、索尼VPCEG-212T、惠普Pavilion g4、宏碁5755G和苹果MacBook Pro这10款热门笔记本电脑屏幕的表现如何…

layui轮播图切换会有跳动_Layui中轮播图切换函数说明

### Layui中轮播图切换函数说明 ######## 官方文档 [链接][Link 1] #####![在这里插入图片描述][watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2h1bmFuOTYx_size_16_color_FFFFFF_t_70]关于轮播图的使用和讲解&#xff0c;官方文档例子都说…

android语法高亮编辑器,HighlightTextEditor

软件简介语法高亮HighlightTextEditor是一个安卓代码语法高亮控件&#xff0c;目前已经支持200多种语言&#xff0c;近90多种主题配色方案&#xff0c;同时支持lua扩展&#xff0c;以及自定义语言配置。强烈推荐&#xff0c;一款不可多得的开源控件。支持的语言&#xff1a;aba…

操作系统hpf算法事例_操作系统中常见算法汇总

一、常见作业调度(高级调度)算法1、先来先服务调度算法(FCFS):就是按照各个作业进入系统的自然次序来调度作业。这种调度算法的优点是实现简单&#xff0c;公平。其缺点是没有考虑到系统中各种资源的综合使用情况&#xff0c;往往使短作业的用户不满意&#xff0c;因为短作业等…

android背景不填充,(Android Studio)应用程序背景图像不填充屏幕

我认为它正在发生&#xff0c;因为顶层容器中存在填充...这就是你的情况下的相对布局如果您的相对布局看起来像下面的代码xmlns:tools"http://schemas.android.com/tools"android:layout_width"match_parent"android:layout_height"match_parent"…

android 将图片路径转二进制,将图像转换为二进制图像中的android

八月8日至12日&#xff1a;52&#xff1a;32.887&#xff1a;d/dalvikvm(774)&#xff1a;GC_CONCURRENT释放71K&#xff0c;7&#xff05;的游离 2765K/2964K&#xff0c;暂停23MS 15ms&#xff0c;总计94ms08-12 08&#xff1a;52&#xff1a;33.497&#xff1a;D/gralloc_g…

python写一个路径选择app_django下创建多个app并设置urls方法

1、创建第二个app假设我们项目P下面已经有了一个默认的app&#xff0c;名字是app1。现在我想创建第二个app&#xff0c;名字时app2。进入pychram下的Terminal中&#xff0c;运行命令&#xff1a;python manage.py startapp app2此外&#xff0c;我在每个app下都建立一个urls.py…