Oct-09-2019, 04:39 PM
I have the following script
How would I do that?
import re w = 'KTPA 081653Z 00000KT 10SM BKN022TCU BKN040 OVC001RMK 28/23 A2990 FEW070 RMK AO2 SLP125 TCU SCT080 NW-NE T02830228' k = re.findall("FEW\d+|SCT\d+|BKN\d+|OVC\d+", w) print(k)When I run it, I'm getting
Quote:['BKN022', 'BKN040', 'OVC001', 'FEW070', 'SCT080'], but I only want the integers from it so that it looks like this
Quote:['022', '040', '001', '070', '080']. Once I get the integers, I can sort it to get the lowest number.
How would I do that?