From 7c10e251acaab4842a557bbfc9efc2297a8af741 Mon Sep 17 00:00:00 2001 From: Hariom Vyas Date: Sat, 12 Sep 2020 16:45:13 +0530 Subject: [PATCH 1/5] Create leapyear.py --- projects/Leap_Year_Checker/leapyear.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 projects/Leap_Year_Checker/leapyear.py diff --git a/projects/Leap_Year_Checker/leapyear.py b/projects/Leap_Year_Checker/leapyear.py new file mode 100644 index 000000000..e5076bd28 --- /dev/null +++ b/projects/Leap_Year_Checker/leapyear.py @@ -0,0 +1,6 @@ +year = int(input("Enter a year:- ")) + +if(((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0)): + print("{0} is a leap year!!".format(year)) +else: + print("{0} is not a leap year!!".format(year)) From e960d71c7c0d687f23f3d8e57a8225879cd103b3 Mon Sep 17 00:00:00 2001 From: Hariom Vyas Date: Sat, 12 Sep 2020 16:46:01 +0530 Subject: [PATCH 2/5] Create README.md Added a README for leapyear.py. --- projects/Leap_Year_Checker/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 projects/Leap_Year_Checker/README.md diff --git a/projects/Leap_Year_Checker/README.md b/projects/Leap_Year_Checker/README.md new file mode 100644 index 000000000..d34fb8825 --- /dev/null +++ b/projects/Leap_Year_Checker/README.md @@ -0,0 +1 @@ +Created leapyear.py From f3635dafb3f0121b8807d540fea6c87f4f005b06 Mon Sep 17 00:00:00 2001 From: Hariom Vyas Date: Sat, 12 Sep 2020 20:59:37 +0530 Subject: [PATCH 3/5] Update README.md --- projects/Leap_Year_Checker/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/projects/Leap_Year_Checker/README.md b/projects/Leap_Year_Checker/README.md index d34fb8825..7b0d5dadc 100644 --- a/projects/Leap_Year_Checker/README.md +++ b/projects/Leap_Year_Checker/README.md @@ -1 +1,11 @@ -Created leapyear.py +Script Title +In this project, you can check whether a year is a leap year or not + +Prerequisites +No pre-requisites are required. + +How to run the script +Just use this in any ide or online python compiler. + +Author Name +[Hariom Vyas](https://github.com/Hariom1509) From 2be87baa1f62bdf289a3bde0ca7b29f396cb4e98 Mon Sep 17 00:00:00 2001 From: Hariom Vyas Date: Sat, 12 Sep 2020 21:04:53 +0530 Subject: [PATCH 4/5] Update README.md --- projects/Leap_Year_Checker/README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/projects/Leap_Year_Checker/README.md b/projects/Leap_Year_Checker/README.md index 7b0d5dadc..636aa2092 100644 --- a/projects/Leap_Year_Checker/README.md +++ b/projects/Leap_Year_Checker/README.md @@ -1,11 +1,13 @@ -Script Title -In this project, you can check whether a year is a leap year or not +# Script Title + +With the help of this program, you can check whether a year is leap year or not. +### Prerequisites + +No pre-requisites are required...😀😀 +### How to run the script + +You can run this on any ide or online compiler. -Prerequisites -No pre-requisites are required. - -How to run the script -Just use this in any ide or online python compiler. - -Author Name -[Hariom Vyas](https://github.com/Hariom1509) +## *Author Name* + +[Hariom1509](https://github.com/Hariom1509) From 85b9ded37126946efb9be1e9123e14a633935660 Mon Sep 17 00:00:00 2001 From: Hariom Vyas Date: Sat, 12 Sep 2020 21:11:18 +0530 Subject: [PATCH 5/5] Update leapyear.py --- projects/Leap_Year_Checker/leapyear.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/Leap_Year_Checker/leapyear.py b/projects/Leap_Year_Checker/leapyear.py index e5076bd28..4b1fb3470 100644 --- a/projects/Leap_Year_Checker/leapyear.py +++ b/projects/Leap_Year_Checker/leapyear.py @@ -1,6 +1,12 @@ -year = int(input("Enter a year:- ")) +year = int(input("Enter a year:- ")) # Here, you take the input from the user -if(((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0)): +if(((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0)): + """ + if a year is a multiple of four and a multiple of 100 i.e. if it is a multiple of 400 it is not a leap year + """ print("{0} is a leap year!!".format(year)) + """ + printing the output + """ else: print("{0} is not a leap year!!".format(year))