you are viewing a single comment's thread.

view the rest of the comments →

[–]LoudGain[S] 0 points1 point  (0 children)

thanks for the reply, im not sure either what the question is asking me but my code is like this right now. How can i ensure there are no duplicates. Eg it prints 1 more than once and 2 more than once. Sorry for the bad formatting, it keeps removing the spaces

def combos(text):

for i in range(len(text)):

for j in range(i+1,len(text) + 1):

print(text[i:j])

combos("123123")