From 8274a9515107873a3073fae3b55577d943cf3314 Mon Sep 17 00:00:00 2001 From: ZiYe0429 Date: Fri, 20 Jan 2023 16:39:46 +0000 Subject: [PATCH] Complete leap.py --- .gitpod.yml | 10 ++++++++++ leap/leap.py | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..b1c4d2b --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - init: pip install -r requirements.txt + + diff --git a/leap/leap.py b/leap/leap.py index 50fd034..4ef8130 100644 --- a/leap/leap.py +++ b/leap/leap.py @@ -1,2 +1,9 @@ def leap_year(year): - pass + if year % 400==0: + return True + elif year % 100==0: + return False + elif year % 4==0: + return True + else: + return False