python通过calendar输出指定年份的全年日历

2022-04-26 00:00:00 指定 输出 年份

python通过calendar输出指定年份的全年日历,输出格式和真实日历几乎一样,非常漂亮,系统会提示用户输入年份,输入后一年的日历就显示出来了

"""
皮蛋编程(https://www.pidancode.com)
创建日期:2022/4/24
功能描述:python通过calendar输出指定年份的全年日历
"""
import calendar
print("Show a given years monthly calendar")
print('')
year = int(input("Enter the year:"))
print('')
calendar.prcal(year)
print('')

相关文章