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/darts/darts.py b/darts/darts.py index 4ba1b3b..587162e 100644 --- a/darts/darts.py +++ b/darts/darts.py @@ -1,2 +1,14 @@ -def score(x, y): - pass +def score(x,y): + distance = (x**2 + y**2)**(1/2) + if distance <= 1: + return 10 + elif distance <= 5 and distance > 1: + return 5 + elif distance <= 10 and distance > 5: + return 1 + else: + return 0 + +print(score(0.8,0.8)) +print(score(-5,0)) +print(score(0,-1)) \ No newline at end of file diff --git a/leap/leap.py b/leap/leap.py index 50fd034..55171ba 100644 --- a/leap/leap.py +++ b/leap/leap.py @@ -1,2 +1,10 @@ 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 +#print(leap_year(1900)) \ No newline at end of file