Leap Year Finder in Python


# a year is leap year if it is evenly divisble by 4
# a year is leap year if it is evenly divisible by 4 but may not by 100
# a year is leap year if it is evenly divisible by 4, by 100 as well as by 400

print("Welcome to Leap Year Finder!")

while True:
      
      year = int(input("Plz enter the year: "))
      
      if year % 4 == 0:
            if year % 100 == 0:
                  if year % 400 == 0:
                        print(f"{year} is a Leap Year.")
                  else:
                        print(f"{year} is not a Leap Year.")
            else:
                  print(f"{year} is a Leap Year.")
      else:
            print(f"{year} is not a Leap Year.")
   

    

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes