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 all sublists of a list
- Python | Print diagonals of 2D list
- Python program to print even numbers in a list
- Python program to print odd numbers in a List
- Print anagrams together in Python using List and Dictionary
- Python | Remove and print every third from list until it becomes empty
- Python | Ways to print list without quotes
- Python program to create a list of tuples from given list having number and its cube in each tuple
- Python program to print all Strong numbers in given list
- Python | Program to print duplicates from a list of integers
- Python | Print list after removing element at given index
- Python program to print positive numbers in a list
- Python | Print list elements in circular range
- Python program to print negative numbers in a list
- Python Program for Print Number series without using any loop
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.