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
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python | Convert list of string to list of list
- Python | Convert list of tuples to list of list
- Python | Convert List of String List to String List
- Python program to create a list of tuples from given list having number and its cube in each tuple
- Python | Print list after removing element at given index
- Python program to print all Strong numbers in given list
- Python Program to Print Largest Even and Largest Odd Number in a List
- Python | Filter a list based on the given list of strings
- Python | Check if a list exists in given list of lists
- Python | Convert given list into nested list
- Python | Reshape a list according to given multi list
- Python - Filter the List of String whose index in second List contaons the given Substring
- Print all sublists of a list in Python
- Python | Remove and print every third from list until it becomes empty
- Python | Program to print duplicates from a list of integers
- Python program to print odd numbers in a List
- Python program to print even numbers in a list
- Python program to print positive numbers in a list
- Python program to print negative numbers in a list
- Python | Print list elements in circular range
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.