Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Sample:
- def __init__(self, a, b):
- self.a = a
- self.b = b
- def plus(self):
- return self.a + self.b
- def minus(self):
- return self.a - self.b
- class AdditionalSample:
- def __init__(self, a):
- self.a = a
- self.c = 2
- def power(self):
- return self.a ** self.c
- class ExtendedSample(Sample, AdditionalSample):
- def __init__(self, a, b):
- super().__init__(a, b)
- self.c = 2
- def divide(self):
- return self.a / self.b
- def multiply(self):
- return self.a * self.b
- a = ExtendedSample(3, 6)
- print(a.power())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement