recent

>>> COBOL COMPILER  >>> Make your Computer Welcome You  >>> Windows KMS Activator Free Download + How to Use Windows KMS Activator Ultimate Edition ...   >>> Remove Shortcut Virus From Pen Drive & SD Card  >>> Download and Install Turbo C++or C Software  >>> ലാപ്‌ടോപ് വാങ്ങുമ്പോള്‍ ഈ 6 കാര്യങ്ങൾ ശ്രദ്ധിക്കരുത്!...   >>> How to Get Deleted Files Back from USB or Hard Drive  >>> How To Make Your Own Subtitles With Any Text Editor  >>> How To Clean your RAM using Notepad  >>> Clear Recent Documents Windows 7 & 8    undefined

Thursday, 1 October 2015

Python Program to Check Leap Year
# Python program to check if the input year is a leap year or not

year = int(input("Enter a year: "))
if (year % 4) == 0:
   if (year % 100) == 0:
       if (year % 400) == 0:
           print("{0} is a leap year".format(year))
       else:
           print("{0} is not a leap year".format(year))
   else:
       print("{0} is a leap year".format(year))
else:
   print("{0} is not a leap year".format(year))

No comments :

Post a Comment