Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pairing in a list
#10
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.
Reply


Messages In This Thread
pairing in a list - by jakemace - Feb-02-2021, 03:57 PM
RE: swiss pairing chess tournament - by DPaul - Feb-02-2021, 06:25 PM
RE: swiss pairing chess tournament - by jakemace - Feb-02-2021, 09:45 PM
RE: swiss pairing chess tournament - by DPaul - Feb-03-2021, 07:33 AM
RE: swiss pairing chess tournament - by jakemace - Feb-03-2021, 03:23 PM
RE: swiss pairing chess tournament - by jakemace - Feb-03-2021, 05:25 PM
RE: swiss pairing chess tournament - by DPaul - Feb-04-2021, 07:18 AM
RE: swiss pairing chess tournament - by jakemace - Feb-04-2021, 03:09 PM
RE: swiss pairing chess tournament - by ritta - Feb-04-2021, 04:33 PM
RE: swiss pairing chess tournament - by DPaul - Feb-06-2021, 07:40 AM
making unique pairs in a list - by jakemace - Feb-05-2021, 05:26 PM
RE: making unique pairs in a list - by bowlofred - Feb-05-2021, 05:34 PM
RE: making unique pairs in a list - by jakemace - Feb-05-2021, 06:20 PM
RE: making unique pairs in a list - by Jeff900 - Feb-05-2021, 07:52 PM
RE: making unique pairs in a list - by jakemace - Feb-05-2021, 08:08 PM
RE: making unique pairs in a list - by Jeff900 - Feb-05-2021, 08:32 PM
RE: making unique pairs in a list - by buran - Feb-05-2021, 07:57 PM
RE: making unique pairs in a list - by jakemace - Feb-05-2021, 08:03 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020