input: def evaluate(expression: str) -> int:
      """Evaluates a postfix expression given as a string.
  
      >>> evaluate("2 3 + 4 5 * *")
      46
      >>> evaluate("5 3 4 + *")
      35
      """
      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])
output:     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]