• + 0 comments

    As per the requirement I've created a function and satisfy the possible condition that question mention but I'm confused in this part (This means that in the Gregorian calendar, the years 2000 and 2400 are leap years, while 1800, 1900, 2100, 2200, 2300 and 2500 are NOT leap years.) Here we need to apply some condition

    def is_leap(year): return (year % 400 == 0) or (year % 4 == 0 and year % 100 != 0)

    year = int(input()) print(is_leap(year))