Sunday, August 9, 2015

counting leap year using python

__author__ = 'Polo-Dev'
year = int(input('Enter the year: '))
if year % 4 == 0:
    if year % 100 == 0:
            if year % 400 == 0:
                print ('This is leap year')
            else:
                print('This is not leap year')
    else:
        print('This is leap year')
else:
    print('This is not leap year')

No comments:

Post a Comment

css snippet for blogger code highlighting

code, .code {     display: block;     background: beige;     padding: 10px;     margin: 8px 15px; }