Answer the question
In order to leave comments, you need to log in
Can you explain a small part of the code?
Here is the code from internet
s = input()
i = 0
count = 1
out = ''
while i< (len(s) - 1):
if s[i] == s[i+1]:
count += 1
else:
out = out + s[i] + str(count)
count = 1
i +=1
print(out+ s[i] + str(count)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question