#coding:utf-8 class A(object): def _test1(self): print('this is _test1') def test2(self): print('this is test2') def __test3(self): print('__test3') class B(A): def run(self): self._test1() self.test2() self._A__test3() b = B() a = A() a._A__test3()
19.内置函数二 abs():绝对值 lst = [1,2,-3,1,2,-5] print([abs(i) for i in lst]) enumerate("可迭代对象","序号起始值"):枚举获取键和值,起始值默认为0 lst [1,2,-3,1,2,-5] print([i for i in enumerate(lst)]) print(i for i in enumerate(lst,10)) max():求最大值,放可迭代对象 min():最小值 sum