Python期末重难点复习总结

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循环中

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值