Leap Year

    0

    0

    The code will display the following depending on the input:

    If the input is "2006":

    If the input is "2010":

    If the input is "2012":

    Leap year.

    year = int(input("Which year do you want to check? "))
    if year % 4 == 0:
      if year % 100 == 0:
        if year % 400 == 0:
          print("Leap year.")
        else:
          print("Not leap year.")
      else:
        print("Leap year.")
    else:
      print("Not leap year.")
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.