I have a tuple of lists of strings that looks like this
myList = ['https://wwww.example.com/watch/random-video-12'], ['https://wwww.example.com/watch/random-video-t-14'], ['https://www.example.com/watch/random-video-longest-1']
and i need to remove the last "-" character and every character before that.
result =  for url in myList: result.append(url.split('-')[-1]) print(result)
['12', '14', '1']
url is a list that has a single element,
split('-') on that string split the string into a list of strings that were separated with ‘-‘.
'https://wwww.example.com/watch/random-video-12'.split('-') -> ['https://wwww.example.com/watch/random', 'video', '12'].
list[-1] gives the last element of