input: def evaluate(expression: str) -> int:
      """Evaluate a postfix expression and return the evaluated value.
      >>> evaluate("2 3 + 4 5 * *")
      46
      >>> evaluate("5 3 4 * +")
      17
      """
      
      # split expression into list  
      expression = expression.split() 
      
      # stack to store integer values. 
      stack = []  
      
      # do for every element of expression. 
      for element in expression: 
      
          # If element is an operand push 
          # into stack it's a number only 
          if element.isdigit(): 
              stack.append(int(element)) 
          
          # if element is an operator, 
          # pop two elements from stack 
          # perform respective operations 
          else:  
              val1 = stack.pop() 
              val2 = stack.pop() 
              stack.append(eval(f"{val2} {element} {val1}")) 
      
      # return the value  
      return stack[0]
output:     # split expression into list  
      expression = expression.split() 
      
      # stack to store integer values. 
      stack = []  
      
      # do for every element of expression. 
      for element in expression: 
      
          # If element is an operand push 
          # into stack it's a number only 
          if element.isdigit(): 
              stack.append(int(element)) 
          
          # if element is an operator, 
          # pop two elements from stack 
          # perform respective operations 
          else:  
              val1 = stack.pop() 
              val2 = stack.pop() 
              stack.append(eval(f"{val2} {element} {val1}")) 
      
      # return the value  
      return stack[0]