input: Write a python function to create a closure that retains the state of a counter.
  assert counter()() == 1
  assert counter()() == 2
  assert counter()() == 3
output: def counter():
      count = 0
      def increment():
          nonlocal count
          count += 1
          return count
      return increment