Horje
find all unique substring permutations of a string of a specific length python Code Example
find all unique substring permutations of a string of a specific length python
import itertools

x = "some string"

# aList contains all permutations of all lengths of string x
aList = [each for eachpermut in [''.join(l) for i in range(len(x)) for l in itertools.combinations(x, i+1)] for each in [''.join(eachpermut) for eachpermut in list(itertools.permutations(eachpermut))]]

# aSet only contains unique permutations of aList of varying lengths
aSet = set(aList))




Python

Related
imprt turtle Code Example imprt turtle Code Example
Introduction to distutils in python Code Example Introduction to distutils in python Code Example
stop animation matplotlib Code Example stop animation matplotlib Code Example
Multiple sub in single regex. Code Example Multiple sub in single regex. Code Example
python namedtuple typename Code Example python namedtuple typename Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9