Hi, I got a list like [1,2,3,4,5,6,7,8,9], and each of the values in the list has two specific qualities (let's say the first one is a boolean and the second one is an int). I need to pair them. For the first time, it's easy: I just pick by list slicing. But when it comes to next time, I have to check both if they have paired already in one of the earlier times and if they have the same value of bool. Also, picking the ones that are closest to each other in terms of their int values which I talked about at the beginning. At the end, output will be like [[1,2],[3,4]...] Please do not say just iterate over the list because the problem is I don't know how.
pairing in a list
pairing in a list
|
|
Users browsing this thread: 1 Guest(s)