input: Write a function to compress a given string by replacing all repeating characters with a single instance and its count. If the input string is empty, return an empty string.
  def compress(s): 
      if not s:
          return ""
      output = "" 
      count = 1
      for i in range(1, len(s)): 
          if s[i] == s[i-1]: 
              count += 1
          else: 
              output += str(count) + s[i-1] 
              count = 1
      output += str(count) + s[-1] 
      return output
  
  assert compress("aabbbbbbcccc")=="2a6b4c"
  assert compress("aaabbcc")=="3a2b2c"
  assert compress("")==""
  assert compress("a")=="1a"
  assert compress("ab")=="1a1b"
output: def compress(s): 
      if not s:
          return ""
      output = "" 
      count = 1
      for i in range(1, len(s)): 
          if s[i] == s[i-1]: 
              count += 1
          else: 
              output += str(count) + s[i-1] 
              count = 1
      output += str(count) + s[-1] 
      return output