Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In(1)class Prism:
- def _init_(self,width,height,depth):
- self.width=width
- self.height=height
- self.depth=depth
- def content(self):
- return self.width*self.height*self.depth
- In(2)p1=Prism(10,20,30)
- p1.content()
- ---> 1 p1=Prism(10,20,30)
- 2 p1.content()
- TypeError: object() takes no parameters
- class Prism:
- def __init__(self,width,height,dept):
- self.width = width
- self.height=height
- self.depth =dept
- def content(self):
- return self.width,self.height,self.depth
- p1 = Prism(10,20,30)
Add Comment
Please, Sign In to add comment