def StringCompression(string):
    start = string[0]
    count = 1
    compressed = ''
    for i in range(1, len(string)):
        if string[i] == start:
            count += 1
        else:
            compressed += start + str(count)
            start = string[i]
            count = 1
    return compressed


print(StringCompression('aabbcccdeee_'))

071e6d0f4755489b0b9f0b820b9471ae2d2c8cc1
<mask token>

def StringCompression(string):
    start = string[0]
    count = 1
    compressed = ''
    for i in range(1, len(string)):
        if string[i] == start:
            count += 1
        else:
            compressed += start + str(count)
            start = string[i]
            count = 1
    return compressed


<mask token>

def StringCompression(string):
    start = string[0]
    count = 1
    compressed = ''
    for i in range(1, len(string)):
        if string[i] == start:
            count += 1
        else:
            compressed += start + str(count)
            start = string[i]
            count = 1
    return compressed


print(StringCompression('aabbcccdeee_'))
