1

Python Program to Check if a Year is Leap Year or not

 1 year ago
source link: https://www.geeksforgeeks.org/videos/python-program-to-check-if-a-year-is-leap-year-or-not/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Python Program to Check if a Year is Leap Year or not

Python Program to Check if a Year is Leap Year or not
Hello everyone, welcome to Big Sur Geeks. I
  • 20 Views
  • 16/06/2022

In this video, we will learn how to find whether the year is a leap year or not. We will divide this video into 3 sections to find prime numbers. Below is the list of sections that we will cover in this video:

1. Difference between a leap year and a non-leap year. 2. Approach of the finding of a leap year. 3. Code for finding leap year.

A leap year is one in which there is an extra day. Instead of the usual 365 days, it has 366 days. In February, an extra day is added to the month, which now contains 29 days instead of the usual 28. Every four years, there are leap years.

To find a leap year we will check whether year is a multiple of 4 and not a multiple of 100 or a year is a multiple of 400, this approach will tell us whether it is a leap year or Not.

There is another way to find a leap year or not using the Python Build-in method, calendar.isleap() which returns a boolean.

Print the number of leap years from the given list of years: https://www.geeksforgeeks.org/python-print-number-of-leap-years-from-given-list-of-years/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK