import calendar #导入模块
nian=int(input(‘请输入年份’))
yue=int(input(‘请输入月份’))
print(calendar.month(nian,yue))

运行效果如下
python 万年历
关注作者会有更多it小知识更新!

相关文章: