distinct substrings of a string python code example
Example: how to get all distinct substrings in a string python
def substr(string):
j=1
a=set()
while True:
for i in range(len(string)-j+1):
a.add(string[i:i+j])
if j==len(string):
break
j+=1
return a