Python Function to determine whether the year is a leap year or not.Any year is entered through the keyboard.

#Python Function to determine whether the year is a leap year or not.Any year is entered through the keyboard.


def find(a):
	if(((a % 4) and (a % 100) and (a % 400))==0):
		i=1
	else:
		i=0
	return i    
print("\nEnter an year : ")
year = int(input())
leap=find(year)
if(leap==1):
	print("\n", year ," year is leap year ")
else:	
	print("\n", year ," year is not a leap year ")

Output :
Enter an year : 2016

2016 year is leap year



Leave a comment