itertools.combinations both ways code example
Example: from itertools import combinations
from itertools import combinations
from itertools import permutations
from itertools import combinations
from itertools import permutations