From 01147c087ef6af2838a8904c537703684fdcb108 Mon Sep 17 00:00:00 2001 From: Chaitanya Desai <71583721+itsmekrrish@users.noreply.github.com> Date: Thu, 1 Oct 2020 19:42:06 +0530 Subject: [PATCH] Python Program to Check Leap Year You can change the value of year in the source code and run it again to test this program --- CheckLeapYear | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 CheckLeapYear diff --git a/CheckLeapYear b/CheckLeapYear new file mode 100644 index 0000000..1e77391 --- /dev/null +++ b/CheckLeapYear @@ -0,0 +1,17 @@ +# Python program to check if year is a leap year or not + +year = 2000 + +# To get year (integer input) from the user +# 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))