python 根據年份,月份信息顯示此月份天數

1 # 普通方法 2 year = int(input('請輸入年份:')) 3 month = int(input('請輸入月份(1~12):')) 4 if month == 2: 5 if year % 4 == 0 and year % 100 != 0 or year % 400 == 0: 6 print('閏年29天') 7 else:
相關文章
相關標籤/搜索