Mar-11-2019, 01:45 PM
Just because it can be done: based on snippsat code one can develop following dense and 'nice' code:
>>> from datetime import datetime >>> values = '201801,201802,201803' >>> [datetime.strptime(f'{el[4:]}-{el[:4]}', '%m-%Y') for el in values.split(',')] [datetime.datetime(2018, 1, 1, 0, 0), datetime.datetime(2018, 2, 1, 0, 0), datetime.datetime(2018, 3, 1, 0, 0)] >>> [(date.month, date.year) for date in [datetime.strptime(f'{el[4:]}-{el[:4]}', '%m-%Y') for el in values.split(',')]] [(1, 2018), (2, 2018), (3, 2018)]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.