Python 輸入一個年份,判斷是否爲閏年

閏年: 4的倍數,可是不能被100整除,且能被400整除input   year = int (input ( "請輸入年份:" )) if (year % 4 ==0 and year % 100 !=0) or year % 400 ==0: print("yes!") else:print("no!")
相關文章
相關標籤/搜索