Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: keras embedding 
Python :: scipy.optimize.curve_fit 3D 
Python :: list object attributes python 
Python :: python text recognition 
Python :: find daily aggregation in pandas 
Python :: python second interval 
Python :: check if input is pandas dataframe 
Python :: python elementTree tostring write() argument must be str, not bytes 
Python :: how to redirect where requests library downloads file python 
Python :: run a shell script from python 
Python :: convert math equation from string to int 
Python :: python enable pyqt errors 
Python :: python word encode asci 
Python :: python make dict 
Python :: binary tree deletion 
Python :: pandas iter groups 
Python :: what is fn.call 
Python :: numpy sort multidimensional array 
Python :: pandas unstring list 
Python :: destructuring in for loops python 
Python :: python function 
Python :: sort decreasing python 
Python :: Python Print Variable Using the f-string in the print statement 
Python :: display column names as a dictionary pandas 
Python :: if syntax in python 
Python :: bag of word scikit learn 
Python :: clear terminal in python 
Python :: pandas append sheet to workbook 
Python :: iterrows pd 
Python :: setup mongodb database with django 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =