input: Write a function to implement a basic calculator.
  assert calculate(10, 5, 'add') == 15
  assert calculate(10, 5, 'subtract') == 5
  assert calculate(10, 5, 'multiply') == 50
  assert calculate(10, 5, 'divide') == 2.0
output: def calculate(a, b, operation):
      if operation == 'add':
          return a + b
      elif operation == 'subtract':
          return a - b
      elif operation == 'multiply':
          return a * b
      elif operation == 'divide':
          return a / b
      else:
          raise ValueError("Invalid operation")