#python引入一个calendar的包
import calendar
yy=int(input('年份:'))
mm=int(input('月份:'))
#使用calendar里面的month
print (calendar.month(yy,mm))

源码截图:

 python编写一个万年历小程序

输出截图:

python编写一个万年历小程序

相关文章: