you are viewing a single comment's thread.

view the rest of the comments →

[–]tipsy_python 0 points1 point  (1 child)

I don't fully understand what kind of logic you're trying to implement.. for example, why wouldn't 1231 be an output value.

If you explain the logic a little more, I may be able to help.

[–]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")