input: Write a function called compress that takes a string s as input and returns a compressed string by replacing all repeating characters with a single instance and its count. If the given string is empty then return an empty string.
  assert compress("aabbbbbbcccc")=="2a6b4c"
  assert compress("aabbcc")=="2a2b2c"
  assert compress("abc")=="1a1b1c"
  assert compress("")==""
  assert compress("aaabbbccc")=="3a3b3c"
output: def compress(s):
      if not s:
          return ""
      compressed = ""
      count = 1
      for i in range(1, len(s)):
          if s[i] == s[i-1]:
              count += 1
          else:
              compressed += str(count) + s[i-1]
              count = 1
      compressed += str(count) + s[-1]
      return compressed