Python期末重难点复习总结
必备点
1.turtle库 重点
2.蝴蝶曲线
3.数字类型操作符
4.字符串的类型和操作 基本的字符操作符5个
5.math数学库
6.字符串格式化 format等方法
7.异常处理
8.break continue
9.函数的使用 难点递归
10.datatime库的使用
11.递归的使用 汉诺塔问题
12.科赫曲线
13.组合数据类型
14.词频的统计 文件的打开和关闭 使用with···as 读取文件 文件的读写 jieba库的使用
15.一维数据二维数据 json库的使用
16.numpy
17.matplotlib
选择填空题
18.request库的6个网页请求函数
19.re模块
20.Tkinter模块
21.面向对象编程
22.opencv
23.wordcloud库
对于期末考试来说,相关的库只需先了解,在一部分选择填空题出现
列表赋值 、浅拷贝及深拷贝
l1=[1,2,3,4,5]
l2=l1
print(l1)
l2[0]=10
print(l1) # l1 and l2 point the same
l0=l1[:]
l0[0]="use the cut"
print(l1)
print(l0)
import copy
l3=copy.copy(l1)
l3[0]="利用模块copy"
print(l3)
l4=list(l1)
l4[0]="use the list()"
print(l4)
l5=[]
l5.extend(l1)
l5[0]="use the extand()"
print(l5)
l6=[i for i in l1]
l6[0]="use the list next"
print(l6)
print(l1)
运行结果:
[1, 2, 3, 4, 5]
[10, 2, 3, 4, 5]
[10, 2, 3, 4, 5]
['use the cut', 2, 3, 4, 5]
['利用模块copy', 2, 3, 4, 5]
['use the list()', 2, 3, 4, 5]
['use the extand()', 2, 3, 4, 5]
['use the list next', 2, 3, 4, 5]
[10, 2, 3, 4, 5]
### Python数据类型:
数字 字符串 布尔 空值 列表 元组 字典 集合
字符串、列表、元组、字典公共的运算符 in not in
字符串、列表、元组 + * 合并 复制
公共方法: len() del()或del max() min() enumerate()一般用在for循环中