Skip to navigation
Get one month back from year month input in python
14.12.20
# input month, year # output just one month back as list [year,month] # example: pyear, pmonth = get_last_month(2021 , 1) def get_last_month(year, month): year = int(year) month = int(month) pmonth = month pyear = year if pmonth == 1: pyear = year -1 pmonth = 12 else: pmonth -= 1
https://docs.python.org/3/library/datetime.html
Reply
Anonymous
Information Epoch 1752525237
Using text data files.
Home
Notebook
Contact us