复习加补充
alt+enter 引用模块,自动安装导入 第三方模块
ctrl+shift+F 在项目中查找关键字
ctrl+shift+N 在项目中查找文件名
ctrl+r 替换 (第一行是原来的内容,第2️⃣行是替换的内容,包括正则大小写都可以)
字符串(str)的查找find,替换replace,分割split,拼接join,首位去空格strip,startwith, enfwith
find和index,find找不到返回-1,
字符串格式化format()
list.index下标,verse反转,count统计,insert插入,pop删除,sort排序,clear清空,append追加,remove删除,
(元组)
{字典}
[列表]
学习内容
- 字典
推荐网站www.json.cn
key:value
- dict.get
找到返回对应value,找不到返回none,或定义字符串
- dict.pop
pop删除,有返回值,删除什么返回什么
- dict.clear
清空字典
- dict.copy
看对比图
- keys和values
返回的是列表
update相当于+
type显示类型
print(type(x))
强制类型转换
list()
int()
str()
float()
tuple()
dict()
print(isinstance(x.list)) #判断x是不是list格式
print(hasattr(x.”append”)) #判断x有没有append属性