Remember derived algorithm to do a month of addition and subtraction (using python representation)

Because the band is between 12 months and years, the lambda expression can be calculated in a step change in years years n months after the code is as follows:

(lambda yearmonth,deltamonth:yearmonth//100*100+(deltamonth+yearmonth%100-1)//12*100+(deltamonth+yearmonth%100-1)%12+1)(202001,-12)

Guess you like

Origin www.cnblogs.com/vanwoos/p/12381285.html