How to display a number of months of a year?

Is it possible to display the first 03 months or more of a year in using the datetime library ?

No there isn’t, calling it would display a month with a number and datetime.now() only displays the current time.
But you can do it with if’s and if you put it in a function correctly it would work like a built in function
Hope this helps :grinning:

m = ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]
 for i in range(3):
	print(m[i])

output

JAN
FEB
MAR
1 Like

In fact, I wanted to use the months with their days like January with his 31 days, February with his 28 or 29 days and March with his 31 days from datetime library. Is it possible ? or is there another method ?

1 Like