So i have a list of list:
[['Musique', 'Shawn Phillips', '2018-08-24', '2018-08-24'], ['Musique', "L'avenue Royale fête l'été!", '2018-08-25', '2018-08-25'], ['Musique', 'Perséides musicales', '2018-08-03', '2018-08-03'], ['Musique', 'Gaétan Leclerc chante Félix et…', '2018-08-17', '2018-08-17'], ['Musique', 'The Ring of Fire : a Johnny Cash Experience', '2018-07-21', '2018-07-21'],
Im looking to extract only the months and days of every lists and i want to use them in another function. but im having a hard time extracting the months and days only.
I need to put them in this function :
def obtain_date(date):
the list of lists is actually another function too
obtain_events
and after i extracted my months/days, im gonna have to find the exact days with another function, but im mostly focused on finding how i can extract the months and days only while having only 1 argument in my
obtain_date(date):
function. Also, after( or before) i extract the months/days, i need to change them to int, as they are currently in a form of strings.
What I have tried:
Tried a few loops like:
for element in obtain_events:
if '2018' in element:
element.remove(2018)
But it didnt work and i also tried a few other loops but im getting confused.