Dec-09-2023, 11:29 PM
Hi.
I have combinations based list with tuple nested
How to find based 3 numbers of my choice if all this 3 numbes is inside of list of tups?
(Any_number,Any_number,Any_number,17,19,20)
it doens't metter the position of elements if all three [look_up_numbs] is inside any of tuples
(13, 14, 15, 17, 18, 20) > No return, it's wrong (miss 19)
(13, 14, 15, 17, 19, 20) > OK, correct
(13, 14, 15, 18, 19, 20) > No return, it's wrong (miss 17)
(13, 14, 16, 17, 18, 20) > No return, it's wrong (miss 19)
(17, 18, 19, 20, 25, 26) > OK, correct
I have combinations based list with tuple nested
How to find based 3 numbers of my choice if all this 3 numbes is inside of list of tups?
import itertools all_num = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] *res, = itertools.combinations(all_num,6)look_up_numbs = (17,19,20) >>> lookup for this numbers inside of each tuples
(Any_number,Any_number,Any_number,17,19,20)
it doens't metter the position of elements if all three [look_up_numbs] is inside any of tuples
(13, 14, 15, 17, 18, 20) > No return, it's wrong (miss 19)
(13, 14, 15, 17, 19, 20) > OK, correct
(13, 14, 15, 18, 19, 20) > No return, it's wrong (miss 17)
(13, 14, 16, 17, 18, 20) > No return, it's wrong (miss 19)
(17, 18, 19, 20, 25, 26) > OK, correct