用fuction 函数过程S=1+(1+2)+(1+2+3)+(1+2+3+4)……+(1+2+3+4+……+n),其中,n是任意输入的一个值.
用fuction 函数过程S=1+(1+2)+(1+2+3)+(1+2+3+4)……+(1+2+3+4+……+n),其中,n是任意输入的一个值.
日期:2020-05-30 11:00:36 人气:1
1、首先python 3.x版本的实现:super().父类方法,如下图所示。
2、结果:A class: 2,B class: 1,如下图所示。
3、python 2.x版本实现:super(子类名,self).父类方法,如下图所示。
4、运行结果:A class: 2,B class: 1。如下图所示。
5、 # super(FooChild,self) 首先找到 FooChild 的父类(就是类 FooParent),然后把类B的对象 FooChild 转换为类 FooParent 的对象