2020年12月26日 星期六

判斷是否為閏年

year=int(input("enter one number of year"))
if (year%4)==0:
    if (year%100)==0:
         if(year%400)==0:
             print("{}是閏年".format(year))
         else:
             print("{}是平年".format(year))
    else:
        print("{}是平年".format(year))
else:
    print("{}是平年".format(year))
    

沒有留言:

張貼留言

二維陣列(2d array) matrix

import numpy as np fru_items=[["apple","banana","cherry","durian","eggplant","fig...