What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-06 11:10:04
python permutation
# A Python program to print all permutations using library function from itertools import permutations perm = permutations([1, 2, 3]) for i in list(perm): print (i) # (1, 2, 3) # (1, 3, 2) # (2, 1, 3) # (2, 3, 1) # (3, 1, 2) # (3, 2, 1) Add solution -
Shell/Bash 2022-02-06 20:50:27
conda install more-itertools
conda install -c anaconda more-itertools Add solution -
-
Python 2022-02-02 21:10:33
count iterator
# Python program to demonstrate # infinite iterators import itertools # for in loop for i in itertools.count(5, 5): if i == 35: break  ... Add solution -
Python 2022-01-29 12:40:19
python how to unnest a nested list
# Basic syntax: unnested_list = list(chain(*nested_list)) # Where chain comes from the itertools package and is useful for # unnesting any iterables # Example usage: from itertools import chain nested_list = [[1,2], [3,4]] my_unnested_list = list(chain(... Add solution -