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文件打开,根据安装器提示进行安装即可。安装完成…

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

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

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

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

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

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

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

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

android语法高亮编辑器,HighlightTextEditor

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

java类初始化顺序_Java 类的初始化顺序

静态代码块:用staitc声明,jvm加载类时执行,仅执行一次构造代码块:类中直接用{}定义,每一次创建对象时执行执行顺序优先级:静态块,main(),构造块,构造方法1. 构造函数public HelloWorld(){ }关于构造函数&am…

docker 获取宿主机ip_Docker基础修炼6——网络初探及单机容器间通信

如果觉得文章有帮助,欢迎点击头像关注我获取更多原创文章,同时也欢迎转发。同时也可以在我的历史文章中找到Linux操作系统相关的服务器运维管理入门系列文章,欢迎交流。前文演示docker容器内部数据共享与持久化,本文继续讨论docke…

html设计动画小黄人,CSS3实现可爱的小黄人动画

每次看到CSS3动画就心痒痒想试一下,记得一个多月前看了白树哥哥的一篇博客,突然开窍,于是拿他提供的demo试了一下,感觉很棒!下图为demo提供的动画帧设计稿。自己也想说搞一个DIY的动画出来,可是&#xff0c…

python函数进阶小结_python之函数进阶

1. 今日内容 1.1 函数的参数 *的魔性用法 函数形参最终顺序 1.2名称空间 全局名称空间,局部名称空间,内置名称空间 取值顺序与加载顺序 作用域 内置函数:globals() locals() 1.3 高阶函数(函数的嵌套) 1.4关键字&#…

鸿蒙空间是什么星辰变,飞升之后做什么《星辰变》神魔妖界收伏奇珍异兽

十年经典,再续流星!由阅文白金作者“我吃西红柿”同名小说改编《星辰变》手游正在火热预约中,现在前往游戏官网即可预约游戏获得专属福利。作为一款由修真小说改编的手游作品,《星辰变》手游拥有着超千万字的游戏剧本,并且依照小说…

大数据数据收集数据困难_大数据就是好数据吗?研究人员在处理大数据集时遭遇的 5 大挑战...

大数据给每个科研领域的研究方式带来了前所未有的变化。每个领域中,研究人员可使用的工具皆有显著性,大数据现在逐渐成为横跨各学科领域的共同工具。大数据集的可取得性以及可存储并共享大量的数据的能力为研究人员打开了科学探索的几条途径。数据是研究…

docker privileged作用_docker总结

docker基本命令是一个开源的应用容器引擎;是一个轻量级容器技术;docker主机(Host):安装了Docker程序的机器(Docker直接安装在操作系统之上);docker客户端(Client):连接docker主机进行操作&#…

edge播放视频HTML5黑屏,edge不能播放网页视频怎么办-修复edge浏览器播放视频黑屏的方法 - 河东软件园...

Microsoft Edge是微软在更新win10系统的同时发布的一款新浏览器,它基于IE浏览器设计,是新一代的微软指定浏览器!这款浏览器从上市到现在一直都是备受争议的软件,有的用户喜欢使用IE,也有用户喜欢Edge。在使用新版本的e…

c语言乘法口诀表的流程图_例18:C语言编程实现九九乘法表

例18&#xff1a;C语言编程实现九九乘法表&#xff0c;样式要求长方形、右三角形、左三角形。解题思路&#xff1a;这个问题的算法很简单&#xff0c;就是两个for循环的嵌套&#xff0c;三角形的样式就是多了一些空格。长方形源代码演示&#xff1a;#include<stdio.h>//头…

python包和目录有什么不同_python模块和包的区别

在计算机程序的开发过程中&#xff0c;随着程序代码越写越多&#xff0c;在一个文件里代码就会越来越长&#xff0c;越来越不容易维护。为了编写可维护的代码&#xff0c;我们把很多函数分组&#xff0c;分别放到不同的文件里&#xff0c;这样&#xff0c;每个文件包含的代码就…

2021年宝鸡中学高考成绩查询,宝鸡中学排名前十名,2021年宝鸡中学排名一览表

很多家长关心宝鸡2020年最新的中学排名&#xff0c;选择一所好的中学尤为重要&#xff0c;本文小编整理了一些关于2020年宝鸡最新的中学排名相关数据&#xff0c;仅供参考。一、宝鸡中学排名前十名名单排名学校名称人气所在省所在市类型1扶风县扶风高中2822陕西宝鸡市省级示范高…

linux卸载python3_linux卸载python3

广告关闭 腾讯云11.11云上盛惠 &#xff0c;精选热门产品助力上云&#xff0c;云服务器首年88元起&#xff0c;买的越多返的越多&#xff0c;最高返5000元&#xff01; 一、卸载自带python1.rpm -qa | grep python | xargs rpm -e --allmatches --nodeps强制卸载自带的python以…

我xp电脑桌面没有计算机图标不见了,xp系统我的电脑图标不见了怎么办|如何找回我的电脑图标-系统城...

xp系统我的电脑图标不见了怎么办&#xff1f;我们使用xp电脑过程中&#xff0c;有时候会不小心把我的电脑图标给弄丢了&#xff0c;对于一些新手来说&#xff0c;不知道我的电脑图标不见了怎么解决&#xff0c;下面小编就教大家如何找回雨林木风xp纯净版系统我的电脑图标。XP我…