I need to get the substring which is continuous more than one char
This is my code:
l = []
p = 'abbdccc'
for i in range(len(p)-1):
m = ''
if p[i] == p[i+1]:
m +=p[i]
l.append(m)
print(l)
- My string is 'abbdccc'
bandcare repeated more than 1 times- expected out is
['bb', 'ccc']
if My string is '34456788' then my out is ['44', '88']