python基础特性

str:
find(c,start,end)
replace(str1,str2,替换次数)
dict:
dict.update(weight=80,dept='财务')
pop 删除指定的key
dict.pop('weight')
popitem 删除最后一个kv
dict.popitem()
clear 清空字典
dict.clear()
python字典底层原理
hash("abc")同一次运行hash值一样
类的多态
super().init(self, property)
类的魔法方法
--str--
@property
@--slots-- 使用--slots--限制新的属性和方法,继承之后会拼接父类的--slots--
类的静态方法和实例方法
@staticmethod 静态方法
@classmethod 类方法,相当于二次构造方法

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务