input: Write a function to compress a given string by replacing all repeating characters with a single instance and its count.
  
  def compress(s): 
      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
  
  s1 = "aabbbbbbcccc"
  s2 = "abc"
  s3 = "aaabbbccc"
  s4 = ""
  
  assert compress(s1)=="2a6b4c"
  assert compress(s2)=="1a1b1c"
  assert compress(s3)=="3a3b3c"
  assert compress(s4)=="0"
output: def compress(s): 
      if not s:
          return "0"
      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