human
Count of Leap Years in a given year range | Function to calculate the number of leap years in range of ( 1 , year ).
Function to calculate the number of leap years in given range.
Driver Code"
How can the above be solved in Python?
 ... Write me a code to count of Leap Years in a given year range and the other steps required?
assistant
#Here is code to count of Leap Years in a given year range and the other steps required.
 def calNum ( year ) :
	return ( year // 4 ) - ( year // 100 ) + ( year // 400 ) ;
def leapNum ( l , r ) :
	l -= 1 ;
	num1 = calNum ( r ) ;
	num2 = calNum ( l ) ;
	print ( num1 - num2 ) ;
if __name__ == " _ _ main _ _ " :
	l1 = 1 ; r1 = 400 ;
	leapNum ( l1 , r1 ) ;
	l2 = 400 ; r2 = 2000 ;
	leapNum ( l2 , r2 ) ;