diff --git a/darts/darts.py b/darts/darts.py index 4ba1b3b..003961a 100644 --- a/darts/darts.py +++ b/darts/darts.py @@ -1,2 +1,16 @@ +import math + def score(x, y): - pass + # Calculate the distance from the center using the Pythagorean theorem + distance = math.sqrt(x**2 + y**2) + + # Determine the score based on the distance + if distance <= 1: + return 10 # Inner circle + elif distance <= 5: + return 5 # Middle circle + elif distance <= 10: + return 1 # Outer circle + else: + return 0 # Outside the target + diff --git a/leap/leap.py b/leap/leap.py index 50fd034..b8198e6 100644 --- a/leap/leap.py +++ b/leap/leap.py @@ -1,2 +1,14 @@ 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(2004)) + + +