input: Write a function to evaluate a given postfix expression in Python. The input to the function should be a string representing the postfix expression. The function should return the evaluated value of the expression. If the input expression is invalid, return None.
  assert evaluate("2 3 + 4 5 * *")==46
  assert evaluate("3 4 * 2 5 + *")==50
  assert evaluate("5 3 4 + *")==35
  assert evaluate("2 3 + 4 *")==20
  assert evaluate("")==None
output: def evaluate(expression):
      if not expression:
          return None
      stack = []
      tokens = expression.split()
      for token in tokens:
          if token.isdigit():
              stack.append(int(token))
          else:
              if len(stack) < 2:
                  return None
              b = stack.pop()
              a = stack.pop()
              if token == '+':
                  stack.append(a + b)
              elif token == '-':
                  stack.append(a - b)
              elif token == '*':
                  stack.append(a * b)
              elif token == '/':
                  stack.append(a / b)
              else:
                  return None
      return stack[0] if len(stack) == 1 else None