In Python, Leap Year Check

year = int(raw_input('Enter year: '))
msg = 'is not'
days = 28
if (0 == year%100 and 0 == year%400) or (0 != year%100 and 0 == year%4):
    msg = 'is'
    days = 29
print year, msg, 'a leap year'
print 'Febuary has', days, 'days'

Comments

Popular posts from this blog