input: Write a python function to perform basic arithmetic operations using a class.
  assert Calculator(2, "+", 4).calculate() == 6
  assert Calculator(10, "-", 3).calculate() == 7
  assert Calculator(5, "*", 6).calculate() == 30
  assert Calculator(8, "/", 2).calculate() == 4
output: class Calculator:
      def __init__(self, num1, operator, num2):
          self.num1 = num1
          self.operator = operator
          self.num2 = num2
  
      def calculate(self):
          if self.operator == "+":
              return self.num1 + self.num2
          elif self.operator == "-":
              return self.num1 - self.num2
          elif self.operator == "*":
              return self.num1 * self.num2
          elif self.operator == "/":
              return self.num1 / self.num2
          else:
              raise ValueError("Invalid operator")