input: Write a function to evaluate a postfix expression and return the evaluated value. The input to the function is a string containing the postfix expression. The output is the evaluated value of the expression. If the input string is empty, return 0.
  def evaluate(expression):
      if not expression:
          return 0
      expression = expression.split()
      stack = []
      for element in expression:
          if element.isdigit():
              stack.append(int(element))
          else:
              val1 = stack.pop()
              val2 = stack.pop()
              if element == '+':
                  stack.append(val2 + val1)
              elif element == '-':
                  stack.append(val2 - val1)
              elif element == '*':
                  stack.append(val2 * val1)
              elif element == '/':
                  stack.append(val2 / val1)
      return stack[0]
  assert evaluate("2 3 + 4 5 * *") == 46
  assert evaluate("5 3 1 - +") == 7
  assert evaluate("10 3 * 2 -") == 28
  assert evaluate("8 4 / 2 +") == 4
  assert evaluate("") == 0
output: def evaluate(expression):
      if not expression:
          return 0
      expression = expression.split()
      stack = []
      for element in expression:
          if element.isdigit():
              stack.append(int(element))
          else:
              val1 = stack.pop()
              val2 = stack.pop()
              if element == '+':
                  stack.append(val2 + val1)
              elif element == '-':
                  stack.append(val2 - val1)
              elif element == '*':
                  stack.append(val2 * val1)
              elif element == '/':
                  stack.append(val2 / val1)
      return stack[0]