from itertools import *
mas=[1,2,3,4]
for i in product(mas,repeat=4): # набор из представленных элементов
print(i)
for i in permutations(mas,3): # перестановки с повторениями
print(i)
print()
for i in combinations(mas,3): # перестановки без повторений
print(i)