Hello,
Thanks everyone. I notice I wasn’t clear, sorry.
I know itertool.combinations but, except if I am wrong, I believe that we can not have multiple iterators with it. I explain :
With this code, for example, I have as result :
1/ how can I generate only one time (0,0,0) with no repetition ?
2/ in the same way, how can I generate them with only three different digits (ie (1,2,3)) ?
I’ve watched the youtube video. Very useful, interesting. A great thank to you ! But I didn’t understand how it could help me to solve this problem. By using set function maybe ?
I’ll watch the other videos, but there a lot (more than 200 !) so it will take time.
I hope I was more clear, I’ll go step by step, sorry.
Thanks everyone. I notice I wasn’t clear, sorry.
I know itertool.combinations but, except if I am wrong, I believe that we can not have multiple iterators with it. I explain :
my_example = [(x,v,w) for x in list(range(6)) for y in list(range(7)) for z in list(range(8))]Here, I have three different ranges (6, 7 and 8). If I use itertools, I can use only one, no ?
With this code, for example, I have as result :
Output:[(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (1, 0, 0) [...]
My wish is to know :1/ how can I generate only one time (0,0,0) with no repetition ?
2/ in the same way, how can I generate them with only three different digits (ie (1,2,3)) ?
I’ve watched the youtube video. Very useful, interesting. A great thank to you ! But I didn’t understand how it could help me to solve this problem. By using set function maybe ?
I’ll watch the other videos, but there a lot (more than 200 !) so it will take time.
I hope I was more clear, I’ll go step by step, sorry.