s="abcabcabc"
S=list(s)
li=[]
l=[]
for i in S:
if i not in l:
l.append(i)
else:
li.append(l)
l=[]
l.append(i)
print(li)
output is
[['a', 'b', 'c'], ['a', 'b', 'c']]
getting only two substring instead of three
the output i want is
[['a','b','c'],['a','b','c'],['a','b','c']]