input: from typing import List
  
  
  def matching_paren(s: str) -> bool:
      """ Given a string, this function evaluates if all parentheses '(' and ')' are properly matched.
      A valid string should have all its opening parentheses '(' closed with a corresponding ')' in the correct order.
  
      For example, the following are valid cases:
      - "(a(b)c)"       # True
      - "(())"          # True
      - "a(b)c"         # True
  
      While these are invalid:
      - ")("            # False
      - "(()"           # False
      - "("             # False
  
      This function uses a stack to keep track of opening parentheses and ensures that each closing parenthesis matches the most recent unclosed opening parenthesis.
  
      >>> matching_paren("(a(b)c)")
      True
      >>> matching_paren(")(")
      False
      >>> matching_paren("(()")
      False
      >>> matching_paren("(())")
      True
      """
      stack = []
      for char in s:
          if char == '(':
              stack.append(char)
          elif char == ')':
              if len(stack) == 0:
                  return False 
              stack.pop()
      
      if len(stack) == 0:
          return True
      else:
          return False
output:     stack = []
      for char in s:
          if char == '(':
              stack.append(char)
          elif char == ')':
              if len(stack) == 0:
                  return False 
              stack.pop()
      
      if len(stack) == 0:
          return True
      else:
          return False