Python Forum
Select the other of 2 items in a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select the other of 2 items in a list
#8
(Sep-01-2020, 04:09 PM)buran Wrote:
(Aug-31-2020, 08:30 PM)Clunk_Head Wrote: I need to be able to have one item of a list in a variable and use that yo put the other into a separate variable.
I think the solution, provided bu bowlorfred, that shuffle pieces and then unpack in two separate variables does exactly that and is the best one

Not really, as they are to be drawn in separate pieces. This was not made evident by my original question or example. His later answer of using list comprehension serves the purpose for which I intended this code. I replied as such and marked the thread as solved.
Reply


Messages In This Thread
RE: Select the other of 2 items in a list - by Clunk_Head - Sep-01-2020, 05:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Feed List items with Integer euras 9 831 May-19-2021, 07:45 PM
Last Post: snippsat
  Parse String between 2 Delimiters and add as single list items lastyle 5 744 Apr-11-2021, 11:03 PM
Last Post: lastyle
  Sum of list items tristanfermat 2 608 Feb-06-2021, 12:04 PM
Last Post: tristanfermat
  Count number of occurrences of list items in list of tuples t4keheart 1 678 Nov-03-2020, 05:37 AM
Last Post: deanhystad
  concatenating 2 items at a time in a python list K11 3 693 Oct-21-2020, 09:34 AM
Last Post: buran
  Removing items from list if containing a substring pythonnewbie138 2 780 Aug-27-2020, 10:20 PM
Last Post: pythonnewbie138
  Select correct item from list for subprocess command pythonnewbie138 6 1,038 Jul-24-2020, 09:09 PM
Last Post: pythonnewbie138
  Print the number of items in a list on ubuntu terminal buttercup 2 819 Jul-24-2020, 01:46 PM
Last Post: ndc85430
  How to put the items of one list in new generated lists Bobbear 1 663 Jun-12-2020, 06:08 AM
Last Post: buran
  Compare Two Lists and Replace Items In a List by Index nagymusic 2 1,263 May-10-2020, 05:28 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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