python一年月份
To print the calendar of any year, we will use the calendar module in the program by using the import function. A valid year is provided by the user and we have to print the calendar.
要打印任何年份的日历 ,我们将使用导入功能在程序中使用日历模块 。 用户提供了有效的年份,我们必须打印日历。
日历模块 (The calendar module)
calendar is an inbuilt module in Python which provides us some useful functions to solve tasks based on date, month and year.
calendar是Python中的内置模块,它为我们提供了一些有用的功能,可以根据日期,月份和年份解决任务。
Code:
码:
# importing the module
import calendar
# input the year
year=int(input("Enter year: "))
# printing the calendar
print(