python array of last n months

Solutions on MaxInterview for python array of last n months by the best coders in the world

showing results for - "python array of last n months"
Valeria
17 Oct 2019
1x = 10 #N Months
2now = time.localtime()
3print([time.localtime(time.mktime((now.tm_year, now.tm_mon - n, 1, 0, 0, 0, 0, 0, 0)))[:2] for n in range(x)])
similar questions
queries leading to this page
python array of last n months