I've got a list of strings, where each string contains a datestring in the second part, e.g.:
alist = ['foo_20150901', 'bar_20150801', 'baz_20150701']
Now I want to have them ordered ascending with respect to the date. I thought this would work like this:
slist = alist.sort(key =(lambda k: int(k.split('_')[-1])))
However, printing slist yields None
. What's wrong here?