
python
AILEARNER_L
这个作者很懒,什么都没留下…
展开
-
python中@的作用
class Pizza(object): def __init__(self): self.toppings = [] def __call__(self, topping): # When using '@instance_of_pizza' before a function definition # the function...原创 2020-05-04 12:37:31 · 460 阅读 · 0 评论 -
slice(start,end,step)
相当于截取列表的一种方法。 1.当只输入一个参数,默认为end a = ["a", "b", "c", "d"] x = slice(3) a[x] #output:['a', 'b', 'c'] 2.当输入两个参数时,默认为start 和and a = ["a", "b", "c", "d"] x = slice(1,3) a[x] #output:['b','b'] 3.输入三个...原创 2020-04-14 11:10:57 · 692 阅读 · 0 评论 -
python-类 实例
原创 2019-09-21 17:44:52 · 169 阅读 · 0 评论