Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Parallelogram:
- def __init__(self, a, b, angle):
- self._a = a
- self._b = b
- self._angle = angle
- def perimeter(self, a, b):
- print("Perimeter of parellelogram:", (self._a + self._b) * 2)
- def area(self, a, b, angle):
- from math import sin
- from math import radians
- print("Area of parallelogram:", self._a * self._b * sin(radians(self._angle)))
- """
- class Pyramid:
- def __init(self, h, a, b):
- self._a = a
- self._b = b
- self._h = h
- def volume(self, h, a, b):
- print("Volume of pyramid = ", (int(self._h) * int(self._a) * int(self._b) / 3))
- def lateral_area(self, h, a, b):
- print((self._a + self._b) * self._h)
- """
- a = int(input("a = "))
- b = int(input("b = "))
- angle = int(input("angle = "))
- #h = int(input("H of Pyramid: "))
- # Parallelogram
- p = Parallelogram(a, b, angle)
- s = Parallelogram(a, b, angle)
- p.perimeter(a, b)
- s.area(a, b, angle)
- # Pyramid
- """
- v = Pyramid()
- l = Pyramid()
- v.volume(h, a, b)
- l.lateral_area(h, a, b)
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement