Leap Year

    0

    0

    Mahendra Kumar

    beginnerlogic

    To verify if the given year is a leap year or not

    # take input
    year = int(input('Enter a year: '))
    # check leap year or not
    if (year % 400) == 0:
        print('{0} is a leap year'.format(year))
    elif (year % 100) == 0:
        print('{0} is not a leap year'.format(year))
    elif (year % 400) == 0:
        print('{0} is a leap year'.format(year))
    else:
        print('{0} is not a leap year'.format(year))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.