human
Give me a code to find the first day of a given year from a base year having first day as Monday and the other steps required given the following:
Find the first day of a given year from a base year having first day as Monday | Function to find the day of 1 st January of Y year.
Count years between years Y and B.
Count leap years.
Non leap years.
Total number of days in the years lying between the years Y and B.
Actual day.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to find the first day of a given year from a base year having first day as Monday and the other steps required.
 def findDay ( Y , B ) :
	lyear , rest , totaldays , day = 0 , 0 , 0 , 0 ;
	Y = ( Y - 1 ) - B ;
	lyear = Y // 4 ;
	rest = Y - lyear ;
	totaldays = ( rest * 365 ) + ( lyear * 366 ) + 1 ;
	day = ( totaldays % 7 ) ;
	if ( day == 0 ) :
		print ( " Monday " ) ;
	elif ( day == 1 ) :
		print ( " Tuesday " ) ;
	elif ( day == 2 ) :
		print ( " Wednesday " ) ;
	elif ( day == 3 ) :
		print ( " Thursday " ) ;
	elif ( day == 4 ) :
		print ( " Friday " ) ;
	elif ( day == 5 ) :
		print ( " Saturday " ) ;
	elif ( day == 6 ) :
		print ( " Sunday " ) ;
	else :
		print ( " INPUT ▁ YEAR ▁ IS ▁ WRONG ! " ) ;
if __name__ == ' _ _ main _ _ ' :
	Y = 2020 ; B = 1900 ;
	findDay ( Y , B ) ;