Mar-20-2018, 07:46 PM
1 2 3 4 |
arr2 = [x for x in arr if re.search( 'MINS' , str (x), flags = 0 )] for item in arr2: print (item) |
Search for string values in
|
||||||||
Mar-20-2018, 07:46 PM
Mar-20-2018, 07:53 PM
what is your goal? what is your question? elaborate what problem you have.
Mar-20-2018, 08:18 PM
I'm trying to find multiple values via if conditions as seen below in my code. If either is found in original string array (arr), print out entire string with value. Any help is greatly appreciated, thanks.
Mar-20-2018, 10:53 PM
Hi Guys, I didn't explain well previously. I'm trying to find specific string if available in a string array via if conditions as seen below in my code.
The current code doesn't work, but will only work for the 1st if statement only, without other elif and else statements. This is what I'd like to achieve, if any of the strings found in if conditions found in original string array (arr), print out entire string with string value searched for. Any help is greatly appreciated, thanks ![]()
Mar-21-2018, 01:20 AM
(This post was last modified: Mar-21-2018, 01:21 AM by tannishpage.)
Why is there a print statement inside a list?
Mar-21-2018, 01:52 AM
(I've merged the threads. Please don't start a new thread for the same issue.)
Mar-21-2018, 02:10 AM
Thanks Tannishpage, your solution works, much appreciated
Mar-21-2018, 02:36 AM
You are welcome.
![]() | ||||||||
|