TheAceHome

Untitled

Jun 10th, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. class Steel():
  2. def __init__(self,steeltype,thickness,density,a,b=0):
  3. self.steeltype = steeltype
  4. self.thickness = thickness
  5. self.density = density
  6. self.a = a
  7. self.b = b
  8.  
  9. def S(self):
  10. if self.steeltype==1:
  11. s=a*a
  12. if self.steeltype==2:
  13. s=a*b
  14. if self.steeltype==3:
  15. s=(a*b)/2
  16. print(s)
  17.  
  18. def weight(self):
  19. weigh=(S()*0.001)*self.thickness*self.density
  20.  
  21. def INFO():
  22. print(self.steeltype,self.thickness,self.density,S(),weight())
  23.  
  24. d=Steel(1,2,7800,4)
  25. d.S()
Advertisement
Add Comment
Please, Sign In to add comment