The problem of finding leap year is quite generic and we might face the issue of finding the number of leap years in given list of years. Let’s discuss certain ways in which this can be performed.
Method #1: Using Iteration
Check whether year is a multiple of 4 and not multiple of 100 or year is multiple of 400.
No of leap years are: 3
Method #2: Using
No of leap years are: 2
- Python | Print diagonals of 2D list
- Python | Print all sublists of a list
- Python | Ways to print list without quotes
- Python | Remove and print every third from list until it becomes empty
- Python program to print odd numbers in a List
- Python program to print even numbers in a list
- Print anagrams together in Python using List and Dictionary
- Python program to create a list of tuples from given list having number and its cube in each tuple
- Python | Program to print duplicates from a list of integers
- Python program to print positive numbers in a list
- Python program to print all Strong numbers in given list
- Python program to print negative numbers in a list
- Python | Print list elements in circular range
- Python | Print list after removing element at given index
- Print number with commas as 1000 separators in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.