- 博客(1)
- 收藏
- 关注
原创 Python中class类中数组的定义与用法
Python中class类中数组的定义与用法 在python的class中,数组的定义需要特别注意。具体如下所示: class aaa: ddd = 2 test = [] def __init__(self, tmp=0): self.ccc = tmp self.bbb = [] self.test.append(tmp) def add_num(tmp): tmp.bbb.append(5) a = aaa(5)
2021-05-06 14:03:34 4783 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人