input: Write a function to perform basic arithmetic operations using a dictionary of operator functions.
  assert calculate(4, '+', 5) == 9
  assert calculate(10, '-', 2) == 8
  assert calculate(3, '*', 7) == 21
  assert calculate(8, '/', 2) == 4.0
output: def calculate(a, op, b):
      operations = {
          '+': lambda x, y: x + y,
          '-': lambda x, y: x - y,
          '*': lambda x, y: x * y,
          '/': lambda x, y: x / y
      }
      return operations[op](a, b)