Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Steel():
- def __init__(self,a):
- self.steeltype = a[0]
- self.thickness = a[1]
- self.density = a[2]
- self.a = a[3]
- if len(a)==5:
- self.b = a[4]
- def S(self):
- if self.steeltype==1:
- s=self.a*self.a
- if self.steeltype==2:
- s=self.a*b
- if self.steeltype==3:
- s=(self.a*b)/2
- return s
- def weight(self):
- weigh=(Steel.S(self)*0.001)*self.thickness*self.density
- return weigh
- def INFO(self):
- print(self.steeltype,self.thickness,self.density,Steel.S(self),Steel.weight(self))
- omega=[[1,2,7800,4],
- [2,3,7670,4,3],
- [3,2,7745,6,5],
- [1,5,8000,6],
- [3,2,7640,5,8],
- [1,1,8170,3],
- [2,6,7900,2,3],
- [1,3,8100,],
- [1,4,],
- [3,],
- [2,],
- [2,],
- [2,],
- [2,],
- [2,]]
- d=Steel(omega[0])
- print(d.S())
- print(d.weight())
- d.INFO()
Advertisement
Add Comment
Please, Sign In to add comment