I was wondering how to get all the possible combinations from a list with n-length from python. But there is one catch. It's hard for me to explain as English is not my native language. So I give an example:
If I have a list:
my_List = [1, 2, 3, 4]
I want it to get an output of with length 3 to be
(1, 1, 1)
(1, 1, 2)
(1, 1, 3)
(1, 1, 4)
etc etc
But I do NOT want to have repeated lists. By that I mean, if I already have
(1, 1, 2)
I do not have any need for
(1, 2, 1) and
(2, 1, 1)
Does that make any sence? Any help woudl be much apreciated