Python __ 面向对象基础 import math as m class Rect: l = 0.0 h = 0.0 z = 0.0 def __init__(self, l, h, z): self.l = l self.h = h self.z = z def length(self): return (self.l + self.h) * 2 def area(self): return self.l * self.h # 立方体类Cubic class Cubic(...
知识点: python创建多个构造方法 使用classmethod 将init的参数设为可变类型,在init语句中判断 class Rect: __length = 0 __width = 0 def __init__(self, l, w): self.__length = l self.__wi
质数(5) 思维(5) 二分(5) LCA(4) 线段树(4) 三元环(4) 更多 积分与排名 积分- 191555 排名- 6467 随笔分类 Android开发(11) c++函数(9) DP动态规划(8) HTML / 前端(8) Java(28) Java Web(25) Java框架编程技术(23) JAVA习题(15) Python(25) python习题(45) SQL...
上一篇Python __ 面向对象基础 下一篇7-4 sdut-oop-5 计算长方体和四棱锥的表面积和体积(类的继承) python 本文作者:kingwzun 本文链接:https://www.cnblogs.com/kingwz/p/16333626.html 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。