From bb37cf0572c059cb23f3825b01cd5be4c0de0eec Mon Sep 17 00:00:00 2001 From: s1042992 <40089665+s1042992@users.noreply.github.com> Date: Fri, 1 Oct 2021 15:14:07 +0800 Subject: [PATCH] Create LeapYear.py Create a LeapYear.py file to check if a year is a leap year or not. --- Python/LeapYear.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Python/LeapYear.py diff --git a/Python/LeapYear.py b/Python/LeapYear.py new file mode 100644 index 0000000..2bc5bb2 --- /dev/null +++ b/Python/LeapYear.py @@ -0,0 +1,19 @@ +def check(years): + if (years % 4) == 0: + if (years % 100) == 0: + if (years % 400) == 0: + return True + else: + return False + else: + return True + else: + return False + +if __name__ == '__main__': + year = int(input("please enter a year:")) + if(check(year)): + print("It is a Leap Year") + else: + print("It is Not a Leap Year") +