- leapdays() is a python function which count the number of leap years between the two years.
Syntax-
calendar.leapdays(year1,year2)
Example-
calendar.leapdays(2015,2021) will return 2
because [2016,2020] are two leap years between 2015,2021
program-
#import calendar module
import calendar
print("Enter starting year")
y1=int(input())
print("Enter final year")
y2=int(input())
print("Number of Leap years in between given year is")
print(calendar.leapdays(y1,y2))
Enter starting year
1089
Enter final year
2020
Number of Leap years in between given year is
225
Enter starting year
2011
Enter final year
2021
Number of Leap years in between given year is
3