How I can get the month name from the month number?

How I can get the month name from the month number?

Source Code:

# Python's program to get the month name from the month number
import calendar
import datetime
# Month name from number
print("Month name from number 5:")
month_num = 1
month_abre = datetime.date(2020, month_num, 1).strftime('%b')
month_name = datetime.date(2020, month_num, 1).strftime('%B')
print("Short Name:", month_abre)
print("Full  Name:", month_name)
print("\nList of all months from calendar")
# Print list of all months from calendar
for month_val in range(1, 13):
    print(calendar.month_abbr[month_val], "-", calendar.month_name[month_val])


Comments