In [1]:
year = int (input('Enter a year:'))
if year < 0:
print ('Enter a Valid Year.')
elif year % 400 == 0:
print (year, ' is a Leap Year.')
elif year % 4 == 0 and year % 100 != 0:
print (year, ' is a Leap Year.')
else:
print (year, 'Not a Leap Year.')
Enter a year:2012 2012 is a Leap Year.
No comments:
Post a Comment