input: Write a function to compress a given string by replacing all repeating characters with a single instance and its count. If the given string is empty then return an empty string.
  def compress(s): 
      if s == "":
          return ""
      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
  
  assert compress("aabbbbbbcccc") == "2a6b4c"
  assert compress("abc") == "1a1b1c"
  assert compress("aaabbb") == "3a3b"
  assert compress("") == ""
output: def compress(s): 
      if s == "":
          return ""
      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