python编程从零基础到项目实践第7章学习---类

只是大概写下,具体还没了解透彻

这算是一个基本的类  

class Box1():
def __init__(self,length1,width1,height1):
self.length=length1
self.width=width1
self.height=height1
def volume(self):
return self.length*self.width*self.height

mybox=Box1(10,10,10)
print(mybox.volume())


class后是,类的名字

posted on 2020-08-13 17:53  刘阿童木  阅读(161)  评论(0编辑  收藏  举报

导航