groups of 2,3,4 from a list. Is that possible with itertools?
>>> from itertools import permutations >>> a = [2, 3, 4] >>> list(permutations(a)) [(2, 3, 4), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 2, 3), (4, 3, 2)]
Обсуждают сегодня