Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Steel():
- def __init__(self,steeltype,thickness,density,a,b=0):
- self.steeltype = steeltype
- self.thickness = thickness
- self.density = density
- self.a = a
- self.b = b
- def S(self):
- if self.steeltype==1:
- s=a*a
- if self.steeltype==2:
- s=a*b
- if self.steeltype==3:
- s=(a*b)/2
- print(s)
- def weight(self):
- weigh=(S()*0.001)*self.thickness*self.density
- def INFO():
- print(self.steeltype,self.thickness,self.density,S(),weight())
- d=Steel(1,2,7800,4)
- d.S()
Advertisement
Add Comment
Please, Sign In to add comment