Guest User

Untitled

a guest
Oct 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. In(1)class Prism:
  2. def _init_(self,width,height,depth):
  3. self.width=width
  4. self.height=height
  5. self.depth=depth
  6. def content(self):
  7. return self.width*self.height*self.depth
  8. In(2)p1=Prism(10,20,30)
  9. p1.content()
  10.  
  11. ---> 1 p1=Prism(10,20,30)
  12. 2 p1.content()
  13.  
  14. TypeError: object() takes no parameters
  15.  
  16. class Prism:
  17. def __init__(self,width,height,dept):
  18. self.width = width
  19. self.height=height
  20. self.depth =dept
  21. def content(self):
  22. return self.width,self.height,self.depth
  23.  
  24. p1 = Prism(10,20,30)
Add Comment
Please, Sign In to add comment