Question: Say I have a list a = ['abd', ' the dog', '4:45 AM', '1234 total', 'etc...','6:31 PM', '2:36']
How can I go about removing elements such as 4:45 AM and 6:31 PM and '2:36'? i.e, how can I remove elements of the form number:number|number and those with AM/PM on the end?
To be honest, I havent tried much, as I am not sure really where to even begin, other than something like:
[x for x in a if x != something]
from How can I remove all strings that fit certain format from a list?
No comments:
Post a Comment