input: Write a python function to check if a string of parentheses is balanced.
  assert is_balanced("(())") == True
  assert is_balanced("((())") == False
  assert is_balanced("()()") == True
  assert is_balanced(")(") == False
output: def is_balanced(s: str) -> bool:
      stack = []
      for char in s:
          if char == '(':
              stack.append(char)
          elif char == ')':
              if not stack:
                  return False
              stack.pop()
      return len(stack) == 0