Objective
Create a Python program that compresses a text by indicating how many times each letter is repeated consecutively.
Instructions
- Read a non-empty text without spaces.
- Go through the text grouping the equal characters that come one after another.
- Show each character followed by the number of times it is repeated, even if it is only once. For example,
aaabccbecomesa3b1c2. - The groups are not merged:
aabbaabecomesa2b2a2.
aaabcc
a3b1c2
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise