Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lists
#5
working_config = [(idx, item) for idx, item in config if "GigabitEthernet" in item]
That is if you really do need to keep the row index.
Why do you need them? I would remove the enumerate() if you don't need the index
yeah, that was whay I mean, if you don't need the index
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Lists - by blake7 - Oct-06-2023, 11:22 AM
RE: Lists - by buran - Oct-06-2023, 11:37 AM
RE: Lists - by blake7 - Oct-06-2023, 11:54 AM
RE: Lists - by blake7 - Oct-06-2023, 12:08 PM
RE: Lists - by buran - Oct-06-2023, 12:09 PM
RE: Lists - by buran - Oct-06-2023, 12:29 PM
RE: Lists - by buran - Oct-06-2023, 12:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Split dict of lists into smaller dicts of lists. pcs3rd 3 3,293 Sep-19-2020, 09:12 AM
Last Post: ibreeden
  sort lists of lists with multiple criteria: similar values need to be treated equal stillsen 2 5,028 Mar-20-2019, 08:01 PM
Last Post: stillsen

Forum Jump:

User Panel Messages

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