I have a long list of dates in the form ["2019-11-01 00:15:00+01", "2019-11-01 00:30:00+01", "2019-11-01 00:45:00+01" ... and so on] in the type of strings. I would like to go through the list and remove the "00:15:00+01"-part. I have tried with a dummy list first, but I cant seem to make it work. How can I remove part of the string elements in a list?
url = ['abcdc.com', 'tzr.com']
for i in range(0,len(url)):
if url[i].endswith('.com'):
url[i] = url[:-4]
The code above only returns: url = [[],[]]. Why? Any help you be greatly appreciated!