You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1.2 KiB

title date updated 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 highlight_shrink aside
Python 2020-08-09 14:24:25 2020-09-20 18:23:03 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> true <nil> <nil>

一、python类的实例方法、静态方法和类方法区别及其应用场景

https://blog.csdn.net/helloxiaozhe/article/details/79940321

二、python 中cls和self的区别

self:指的是一个具体实例的本身。如果在class中的某个方法加了@classmethod修饰器,那么这个方法不需要实例化也能直接被其他程序调用。 cls:表示这个类本身。 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']