Python: how to retrieve some values from the elements of a list?
Question: I have a list of elements like this:

`mylist=['event_100of1000', 'event_17of1000', 'event_1000of1000',...]`

How can I extract the "number" of the event only and produce another list, in
the likes of:

`extracted_list=['100','17','1000',...]`?


Answer: You can use 'regex' for this....

    
    
    >>> import re
    >>> mylist=['event_100of1000', 'event_17of1000', 'event_1000of1000']
    >>> [re.findall('_(\d+)', i)[0] for i in mylist]
    
    ['100', '17', '1000']
    

