From a6105a8989065f51a49b2a601ba3be13a7889311 Mon Sep 17 00:00:00 2001 From: Soumili Tapadar <74952491+Soumili1818@users.noreply.github.com> Date: Sat, 30 Oct 2021 19:24:58 +0530 Subject: [PATCH] Create leapyearcode.py --- leapyearcode.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 leapyearcode.py diff --git a/leapyearcode.py b/leapyearcode.py new file mode 100644 index 0000000..1e77391 --- /dev/null +++ b/leapyearcode.py @@ -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))