| 1 | class Calculator: |
| 2 | def __init__(self, n): |
| 3 | self.n = n |
| 4 | |
| 5 | def square(self): |
| 6 | print(f"The square is {self.n*self.n}") |
| 7 | |
| 8 | def cube(self): |
| 9 | print(f"The cube is {self.n*self.n*self.n}") |
| 10 | |
| 11 | def squareroot(self): |
| 12 | print(f"The squareroot is {self.n**1/2}") |
| 13 | |
| 14 | @staticmethod |
| 15 | def hello(): |
| 16 | print("Hello there!") |
| 17 | |
| 18 | a = Calculator(4) |
| 19 | a.hello() |