input: 
  def compress(s: str) -> str:
      """Compresses a given string by replacing all repeating characters with a single instance and its count.
  
      Example:
      >>> compress("aabbbbbbcccc")
      'a2b6c4'
      """
      output = ""
      count = 1
  
      for i in range(len(s)):
          if i + 1 < len(s) and s[i] == s[i + 1]:
              count += 1
          else:
              output += str(count) + s[i]
              count = 1
  
      return output
  
output:     output = ""
      count = 1
  
      for i in range(len(s)):
          if i + 1 < len(s) and s[i] == s[i + 1]:
              count += 1
          else:
              output += s[i] + str(count)
              count = 1
  
      return output