Python Forum
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with parsing strings!
#6
well, it's nice you try list comprehension
final3 = [int(i.split()[-2]) for i in final2]
however, note that this will produce list with 6 elements all of which will be 41 and after that you need to get an element from this list. i.e. it's not necessary to add extra step in the process when basically you do the same what snippsat suggested.
Reply


Messages In This Thread
Help with parsing strings! - by Cenzoooo - Jan-17-2017, 04:12 PM
RE: Help with parsing strings! - by snippsat - Jan-17-2017, 04:18 PM
RE: Help with parsing strings! - by Cenzoooo - Jan-18-2017, 07:11 AM
RE: Help with parsing strings! - by wavic - Jan-18-2017, 07:27 AM
RE: Help with parsing strings! - by Cenzoooo - Jan-18-2017, 07:54 AM
RE: Help with parsing strings! - by buran - Jan-18-2017, 08:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand strings and lists of strings Konstantin23 2 958 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Splitting strings in list of strings jesse68 3 1,950 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  Finding multiple strings between the two same strings Slither 1 2,653 Jun-05-2019, 09:02 PM
Last Post: Yoriz
  Python file parsing, can't catch strings in new line Philia 5 4,230 Apr-29-2018, 01:09 PM
Last Post: snippsat
  lists, strings, and byte strings Skaperen 2 4,383 Mar-02-2018, 02:12 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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