④read readline readlines
- [1] read:读取整个文件内容
- [2] readline:读取下一行的内容
- [3] readlines:读取所有行的内容用来进行遍历
⑤ *args **kwargs
- [1] *args 可以输入不定数量的非关键字参数
- [2] **kwargs 可以输入不定数量的关键字参数
⑥字典的几种表示:
-
[1]
dict1 = {key1:v1,key2:v2}
-
[2]
dict1 = {}
dict1['wangzi'] = 1
dict1['xiaxia'] = 2
-
[3]
a=dict(((1,2),(3,4)))
-
[4]
a = dict(([1,2],(3,4)))
-
[5]
a = dict([(1,2),(1,4)])
-
[6]
a = dict([[1,2],[1,4]])