Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get all permutations of string

# get all permutations of string
import itertools
for p in itertools.permutations('123'):
    print(p)					# ( ' 1 ', ' 2 ', ' 3 ') ( ' 1 ' , ' 3 ', ' 2 ' ) ( ' 2 ', ' 1 ', ' 3 ' )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #permutations #string
ADD COMMENT
Topic
Name
4+6 =