Apr-20-2020, 05:23 PM
Thank you for your patience and this lot of informations.
I discover this possibility :
I’ve tested it, am I right if I deduce it means that y is always superior to x and grows up while y < 8 ? (because y stopped at 7 and x at 6)
I am sorry, you are right. And I need to be more businesslike too.
If I took again my example :
In other words, instead of give me six possibilities with the same digits, Python would give me only one result considering (1,2,3) is the same thing that (2,3,1) that (3,2,1) that…
I discover this possibility :
things = [] for x in range(0, 7): for y in range(x+1, 8): for z in range(y+1, 9): things.append((x, y, z))Can you explain how this code works ?
I’ve tested it, am I right if I deduce it means that y is always superior to x and grows up while y < 8 ? (because y stopped at 7 and x at 6)
Quote:It looks like you've done that above with your my_example code. Can you run it and see how you want it to be different?
I am sorry, you are right. And I need to be more businesslike too.
If I took again my example :
[(x,y,z) for x in range(6) for y in range(7) for z in range(8)]Let’s look all the draws with the numbers 1, 2 and 3 inside, six possibilities listed in the output :
Output:(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
What can I do if I want python considers that these six possibilities are equals and gives me only one time the (1,2,3) possibility in output ?In other words, instead of give me six possibilities with the same digits, Python would give me only one result considering (1,2,3) is the same thing that (2,3,1) that (3,2,1) that…