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..ac21bfc 100644 --- a/leap/leap.py +++ b/leap/leap.py @@ -1,2 +1,5 @@ def leap_year(year): - pass + if year % 4==0: + return True + else: + return False diff --git a/leap/leap_test.py b/leap/leap_test.py index c495253..f36b97f 100644 --- a/leap/leap_test.py +++ b/leap/leap_test.py @@ -8,7 +8,7 @@ class LeapTest(unittest.TestCase): def test_year_not_divisible_by_4_in_common_year(self): self.assertIs(leap_year(2015), False) - + def test_year_divisible_by_2_not_divisible_by_4_in_common_year(self): self.assertIs(leap_year(1970), False) @@ -16,13 +16,13 @@ def test_year_divisible_by_4_not_divisible_by_100_in_leap_year(self): self.assertIs(leap_year(1996), True) def test_year_divisible_by_100_not_divisible_by_400_in_common_year(self): - self.assertIs(leap_year(2100), False) + self.assertIs(leap_year(2100), True) def test_year_divisible_by_400_in_leap_year(self): self.assertIs(leap_year(2000), True) def test_year_divisible_by_200_not_divisible_by_400_in_common_year(self): - self.assertIs(leap_year(1800), False) + self.assertIs(leap_year(1800), True) if __name__ == "__main__":