Leap Year Program in Python
Advertisements
Leap Year Program in Python
Using if...else statement check year is divisible by 4 or not. If year is divisible by 4 it is leap year otherwise not leap year.
Leap Year Program in Python
year = int(input("Enter any Year: "))
if year%4==0:
print "Year is Leap"
else:
print "Year is not Leap"
Output 1
Enter any year: 2000 Year is Leap
Output 2
Enter any year: 2005 Year is not Leap
Google Advertisment
