import itertools as it

# itertools: produkty, permutacje i kombinacje

for i, j in it.product(range(3), range(5)):  # produkt kartezjanski
    print(i, j)
    
print('------------------')

for a, b, c, d in it.product(range(3), "abc", repeat=2):  # potega produktu
    print(a, b, c, d)

print('------------------')

for p in it.permutations([1,2,3,4]):  # permutacje podanego obiektu
    print(p)

print('------------------')

for p in it.permutations([1,2,3,4], 2):  # permutacje ustalonej ilosci obiektow
    print(p)

print('------------------')

for p in it.combinations("abcd", 2):  # kombinacje (bez powtorzen)
    print(p)
