input: Write a python function to perform basic arithmetic operations like addition, subtraction, multiplication, and division.
  assert calculator('add', 10, 5) == 15
  assert calculator('subtract', 10, 5) == 5
  assert calculator('multiply', 10, 5) == 50
  assert calculator('divide', 10, 5) == 2
  assert calculator('add', 15, 20) == 35
  assert calculator('subtract', 100, 50) == 50
output: def calculator(operation, num1, num2):
      if operation == 'add':
          return num1 + num2
      elif operation == 'subtract':
          return num1 - num2
      elif operation == 'multiply':
          return num1 * num2
      elif operation == 'divide':
          return num1 / num2
      else:
          return "Invalid operation"