[Python]代码
#简单小程序from datetime import datetimeimport calendar def getMonths(): d = datetime.now() c = calendar.Calendar() year = d.year month = d.month if month == 1 : <span style="color:transparent">本文来源gaodai#ma#com搞*!代#%^码网%</span> month = 12 year -= 1 else : month -= 1 months = calendar.monthrange(year, month)[1] return months