--- title: Python date: 2020-08-09 14:24:25 updated: 2020-09-20 18:23:03 tags: categories: keywords: description: top_img: comments: cover: toc: toc_number: toc_style_simple: copyright: copyright_author: copyright_author_href: copyright_url: copyright_info: katex: true highlight_shrink: aside: --- ### 一、python类的实例方法、静态方法和类方法区别及其应用场景 [https://blog.csdn.net/helloxiaozhe/article/details/79940321](https://blog.csdn.net/helloxiaozhe/article/details/79940321) ### 二、python 中cls和self的区别 self:指的是一个具体实例的本身。如果在class中的某个方法加了@classmethod修饰器,那么这个方法不需要实例化也能直接被其他程序调用。 cls:表示这个类本身。 [https://blog.csdn.net/gtf215998315/article/details/106868558](https://blog.csdn.net/gtf215998315/article/details/106868558) ### 三、list.extend()和list.append() >>> li = ['a', 'b', 'c'] >>> li.extend(['d', 'e', 'f']) >>> li ['a', 'b', 'c', 'd', 'e', 'f'] >>> len(li) 6 >>> li[-1] 'f' >>> li = ['a', 'b', 'c'] >>> li.append(['d', 'e', 'f']) >>> li ['a', 'b', 'c', ['d', 'e', 'f']] >>> len(li) 4 >>> li[-1] ['d', 'e', 'f']