input: Write a function to evaluate a postfix expression represented as a string. The function should return the integer result of the evaluated expression.
  
  def evaluate(expression):
      expression = expression.split()
      stack = []
      for element in expression:
          if element.isdigit():
              stack.append(element)
          else:
              val1 = stack.pop()
              val2 = stack.pop()
              stack.append(str(eval(val2 + element + val1)))
      return int(stack[0])
  
  assert evaluate("2 3 + 4 5 * *") == 46
  assert evaluate("1 1 + 1 + 1 +") == 4
  assert evaluate("3 4 5 * +") == 23
  assert evaluate("6 2 / 3 - 4 5 * +") == 17
  assert evaluate("9") == 9
output: def evaluate(expression):
      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]