Write a program that prompts the user to input a year and determine whether the year is a leap year or not.

Write a program that prompts the user to input a year and determine whether the year is a leap year or not.

Leap Years are any year that can be evenly divided by 4. A year that is evenly divisible by 100 is a leap year only if it is also evenly divisible by 400. Example :

  1. 1992        Leap Year
  2. 2000        Leap Year
  3. 1900        NOT a Leap Year
  4. 1995        NOT a Leap Year
#program to determine leap year
yr= int(input("Enter year to determine the is it leap or not"))

if (yr%4 == 0 ) or (yr%100 != 0 and yr%400 == 0) :

    print("The year is a leap year!")
else:
    print("The year isn't a leap year!")

jsDelivr CDN plugin by Nextgenthemes

These are the assets loaded from jsDelivr CDN. Do not worry about old WP versions in the URLs, this is simply because the files were not modified. A sha384 hash check is used so you can be 100% sure the files loaded from jsDelivr are the exact same files that would be served from your server.


	

Level up your video embeds with ARVE or ARVE Pro