From edf3d74c4516b488edf62ea7f655bac2e74cbcda Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Wed, 15 Apr 2026 14:00:52 -0400 Subject: [PATCH 1/8] Tweak fundamentals descriptions and add test cases --- .../calculate-absolute/description.md | 2 +- fundamentals/calculate-absolute/io.json | 20 +++++++++ fundamentals/decimal-match/description.md | 7 ++-- fundamentals/decimal-match/io.json | 18 +++++++- .../description.md | 0 .../io.json | 12 ++++++ .../meta.json | 0 .../starter.py | 0 fundamentals/difference_21/description.md | 3 -- fundamentals/difference_21/io.json | 34 --------------- fundamentals/difference_21/meta.json | 10 ----- fundamentals/difference_21/starter.py | 1 - fundamentals/exactly-one-true/description.md | 3 ++ .../io.json | 0 .../meta.json | 0 .../starter.py | 0 fundamentals/exactly_one_true/description.md | 3 -- fundamentals/extract-decimal/io.json | 20 +++++++++ fundamentals/grade-contribution/io.json | 20 +++++++++ fundamentals/grade-from-score/description.md | 9 ++++ .../io.json | 0 .../meta.json | 0 .../starter.py | 0 fundamentals/grade_from_score/description.md | 9 ---- fundamentals/integer-conversion-loss/io.json | 20 +++++++++ fundamentals/is-even/io.json | 20 +++++++++ fundamentals/is-multiple/io.json | 20 +++++++++ fundamentals/makes-ten/io.json | 20 +++++++++ .../description.md | 2 - .../io.json | 12 ++++++ .../meta.json | 0 .../starter.py | 0 .../description.md | 6 ++- .../io.json | 12 ++++++ .../meta.json | 0 .../starter.py | 0 fundamentals/repeat-numbers/io.json | 22 ---------- .../description.md | 2 + fundamentals/repeated-numbers/io.json | 42 +++++++++++++++++++ .../meta.json | 0 .../starter.py | 0 .../temperature-convert/description.md | 7 ---- fundamentals/temperature-convert/io.json | 22 ---------- fundamentals/temperature-convert/meta.json | 10 ----- fundamentals/temperature-convert/starter.py | 1 - fundamentals/triangle-area/description.md | 5 +-- fundamentals/triangle-area/io.json | 20 +++++++++ fundamentals/two-as-one/description.md | 6 ++- fundamentals/two-as-one/io.json | 20 +++++++++ 49 files changed, 303 insertions(+), 137 deletions(-) rename fundamentals/{difference_is_even => difference-is-even}/description.md (100%) rename fundamentals/{difference_is_even => difference-is-even}/io.json (69%) rename fundamentals/{difference_is_even => difference-is-even}/meta.json (100%) rename fundamentals/{difference_is_even => difference-is-even}/starter.py (100%) delete mode 100644 fundamentals/difference_21/description.md delete mode 100644 fundamentals/difference_21/io.json delete mode 100644 fundamentals/difference_21/meta.json delete mode 100644 fundamentals/difference_21/starter.py create mode 100644 fundamentals/exactly-one-true/description.md rename fundamentals/{exactly_one_true => exactly-one-true}/io.json (100%) rename fundamentals/{exactly_one_true => exactly-one-true}/meta.json (100%) rename fundamentals/{exactly_one_true => exactly-one-true}/starter.py (100%) delete mode 100644 fundamentals/exactly_one_true/description.md create mode 100644 fundamentals/grade-from-score/description.md rename fundamentals/{grade_from_score => grade-from-score}/io.json (100%) rename fundamentals/{grade_from_score => grade-from-score}/meta.json (100%) rename fundamentals/{grade_from_score => grade-from-score}/starter.py (100%) delete mode 100644 fundamentals/grade_from_score/description.md rename fundamentals/{minutes_to_seconds => minutes-to-seconds}/description.md (62%) rename fundamentals/{minutes_to_seconds => minutes-to-seconds}/io.json (68%) rename fundamentals/{minutes_to_seconds => minutes-to-seconds}/meta.json (100%) rename fundamentals/{minutes_to_seconds => minutes-to-seconds}/starter.py (100%) rename fundamentals/{number_is_palindrome => number-is-palindrome}/description.md (63%) rename fundamentals/{number_is_palindrome => number-is-palindrome}/io.json (70%) rename fundamentals/{number_is_palindrome => number-is-palindrome}/meta.json (100%) rename fundamentals/{number_is_palindrome => number-is-palindrome}/starter.py (100%) delete mode 100644 fundamentals/repeat-numbers/io.json rename fundamentals/{repeat-numbers => repeated-numbers}/description.md (84%) create mode 100644 fundamentals/repeated-numbers/io.json rename fundamentals/{repeat-numbers => repeated-numbers}/meta.json (100%) rename fundamentals/{repeat-numbers => repeated-numbers}/starter.py (100%) delete mode 100644 fundamentals/temperature-convert/description.md delete mode 100644 fundamentals/temperature-convert/io.json delete mode 100644 fundamentals/temperature-convert/meta.json delete mode 100644 fundamentals/temperature-convert/starter.py diff --git a/fundamentals/calculate-absolute/description.md b/fundamentals/calculate-absolute/description.md index 4213e664..837c666a 100644 --- a/fundamentals/calculate-absolute/description.md +++ b/fundamentals/calculate-absolute/description.md @@ -1,4 +1,4 @@ Write a function `calculate_absolute(n: int) -> int` that takes an integer `n` as input and returns its absolute value. The absolute value of a number is its non-negative value, so if the input is `-5`, the output should be `5`, and if the input is `7`, the output should be `7`. -**Hint**: you may want to Google how to find the absolute value of an integer in Python! \ No newline at end of file +**Hint**: You may want to Google how to find the absolute value of an integer in Python! \ No newline at end of file diff --git a/fundamentals/calculate-absolute/io.json b/fundamentals/calculate-absolute/io.json index ea3494f6..2321a200 100644 --- a/fundamentals/calculate-absolute/io.json +++ b/fundamentals/calculate-absolute/io.json @@ -18,5 +18,25 @@ { "input": [999], "output": 999 + }, + { + "input": [-10000], + "output": 10000 + }, + { + "input": [55], + "output": 55 + }, + { + "input": [-1024], + "output": 1024 + }, + { + "input": [43110], + "output": 43110 + }, + { + "input": [-1], + "output": 1 } ] diff --git a/fundamentals/decimal-match/description.md b/fundamentals/decimal-match/description.md index a3831bfb..1941dad5 100644 --- a/fundamentals/decimal-match/description.md +++ b/fundamentals/decimal-match/description.md @@ -1,7 +1,6 @@ -Write a function `decimal_match(n: int, f: float) -> bool` that takes two inputs: an integer `n` and a floating-point number `f`. The function should return `True` if the decimal part of `f` contains the integer `n` in sequence; otherwise, it should return `False`. +Write a function `decimal_match(n: int, f: float) -> bool` that takes two inputs: a double digit integer `n` and a floating-point number `f` with two decimal digits. The function should return `True` if the decimal part of `f` contains the integer `n` in sequence; otherwise, it should return `False`. + +**Note:** You can assume the integer part will be exactly two digits long, and the decimal part will have exactly two digits. For example: - `decimal_match(11, 0.11) → True` because `11` appears in the decimal part of `0.11`. - - -**Note:** The integer part will always be two digits long, and the decimal part will have exactly two digits. For example: 11 and 0.11 are valid, but 111 or 0.111 (or longer) are not. diff --git a/fundamentals/decimal-match/io.json b/fundamentals/decimal-match/io.json index ef461248..350365ee 100644 --- a/fundamentals/decimal-match/io.json +++ b/fundamentals/decimal-match/io.json @@ -20,7 +20,23 @@ "output": true }, { - "input": [1, 0.2], + "input": [10, 0.20], + "output": false + }, + { + "input": [99, 0.99], + "output": true + }, + { + "input": [55, 0.55], + "output": true + }, + { + "input": [15, 0.15], + "output": true + }, + { + "input": [20, 0.22], "output": false } ] diff --git a/fundamentals/difference_is_even/description.md b/fundamentals/difference-is-even/description.md similarity index 100% rename from fundamentals/difference_is_even/description.md rename to fundamentals/difference-is-even/description.md diff --git a/fundamentals/difference_is_even/io.json b/fundamentals/difference-is-even/io.json similarity index 69% rename from fundamentals/difference_is_even/io.json rename to fundamentals/difference-is-even/io.json index 295d0c3b..09a0aa7b 100644 --- a/fundamentals/difference_is_even/io.json +++ b/fundamentals/difference-is-even/io.json @@ -26,5 +26,17 @@ { "input": [0, 1], "output": false + }, + { + "input": [555, 999], + "output": true + }, + { + "input": [-2, -4], + "output": true + }, + { + "input": [50, 1], + "output": false } ] diff --git a/fundamentals/difference_is_even/meta.json b/fundamentals/difference-is-even/meta.json similarity index 100% rename from fundamentals/difference_is_even/meta.json rename to fundamentals/difference-is-even/meta.json diff --git a/fundamentals/difference_is_even/starter.py b/fundamentals/difference-is-even/starter.py similarity index 100% rename from fundamentals/difference_is_even/starter.py rename to fundamentals/difference-is-even/starter.py diff --git a/fundamentals/difference_21/description.md b/fundamentals/difference_21/description.md deleted file mode 100644 index 6736f529..00000000 --- a/fundamentals/difference_21/description.md +++ /dev/null @@ -1,3 +0,0 @@ -Write a function `difference_21(n: int) -> int` that returns the absolute difference between `n` and 21. - -If `n` is over 21, return double the absolute difference. diff --git a/fundamentals/difference_21/io.json b/fundamentals/difference_21/io.json deleted file mode 100644 index 456b517e..00000000 --- a/fundamentals/difference_21/io.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "input": [19], - "output": 2 - }, - { - "input": [21], - "output": 0 - }, - { - "input": [25], - "output": 8 - }, - { - "input": [0], - "output": 21 - }, - { - "input": [22], - "output": 2 - }, - { - "input": [30], - "output": 18 - }, - { - "input": [20], - "output": 1 - }, - { - "input": [-5], - "output": 26 - } -] diff --git a/fundamentals/difference_21/meta.json b/fundamentals/difference_21/meta.json deleted file mode 100644 index 5138c5f5..00000000 --- a/fundamentals/difference_21/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Difference 21", - "name": "difference_21", - "difficulty": "medium", - "author": "", - "category": "Fundamentals", - "question_type": [ - "coding" - ] -} diff --git a/fundamentals/difference_21/starter.py b/fundamentals/difference_21/starter.py deleted file mode 100644 index 71d9906b..00000000 --- a/fundamentals/difference_21/starter.py +++ /dev/null @@ -1 +0,0 @@ -def difference_21(n: int) -> int: diff --git a/fundamentals/exactly-one-true/description.md b/fundamentals/exactly-one-true/description.md new file mode 100644 index 00000000..6f11d938 --- /dev/null +++ b/fundamentals/exactly-one-true/description.md @@ -0,0 +1,3 @@ +Write a function `exactly_one_true(a: bool, b: bool, c: bool) -> bool` that takes three boolean values and returns `True` if exactly one of them is `True`, and `False` otherwise. + +**Hint**: Try counting how many of the inputs are `True`. diff --git a/fundamentals/exactly_one_true/io.json b/fundamentals/exactly-one-true/io.json similarity index 100% rename from fundamentals/exactly_one_true/io.json rename to fundamentals/exactly-one-true/io.json diff --git a/fundamentals/exactly_one_true/meta.json b/fundamentals/exactly-one-true/meta.json similarity index 100% rename from fundamentals/exactly_one_true/meta.json rename to fundamentals/exactly-one-true/meta.json diff --git a/fundamentals/exactly_one_true/starter.py b/fundamentals/exactly-one-true/starter.py similarity index 100% rename from fundamentals/exactly_one_true/starter.py rename to fundamentals/exactly-one-true/starter.py diff --git a/fundamentals/exactly_one_true/description.md b/fundamentals/exactly_one_true/description.md deleted file mode 100644 index 72f4f389..00000000 --- a/fundamentals/exactly_one_true/description.md +++ /dev/null @@ -1,3 +0,0 @@ -Write a function exactly_one_true(a: bool, b: bool, c: bool) -> bool that takes three boolean values and returns `True` if exactly one of them is `True`, and `False` otherwise. - -**Hint**: Try counting how many of the inputs are `True`. diff --git a/fundamentals/extract-decimal/io.json b/fundamentals/extract-decimal/io.json index a3d64b18..1142dca7 100644 --- a/fundamentals/extract-decimal/io.json +++ b/fundamentals/extract-decimal/io.json @@ -18,5 +18,25 @@ { "input": [5.5], "output": 0.5 + }, + { + "input": [0.0], + "output": 0.0 + }, + { + "input": [304.305], + "output": 0.305 + }, + { + "input": [599.514], + "output": 0.514 + }, + { + "input": [-50.56], + "output": -0.56 + }, + { + "input": [-10.99], + "output": -0.99 } ] diff --git a/fundamentals/grade-contribution/io.json b/fundamentals/grade-contribution/io.json index 9094d40b..5a9b362b 100644 --- a/fundamentals/grade-contribution/io.json +++ b/fundamentals/grade-contribution/io.json @@ -18,5 +18,25 @@ { "input": [50.0, 0.0], "output": 0.0 + }, + { + "input": [100.0, 66.6], + "output": 66.6 + }, + { + "input": [50.0, 50.0], + "output": 25.0 + }, + { + "input": [32.0, 75.0], + "output": 28.0 + }, + { + "input": [40.0, 20.0], + "output": 8.0 + }, + { + "input": [80.0, 25.0], + "output": 20.0 } ] diff --git a/fundamentals/grade-from-score/description.md b/fundamentals/grade-from-score/description.md new file mode 100644 index 00000000..0a379353 --- /dev/null +++ b/fundamentals/grade-from-score/description.md @@ -0,0 +1,9 @@ +Write a function `grade_from_score(score: int) -> str` that takes an integer `score` between 0 and 100 (inclusive) and returns the corresponding letter grade as a string. Use the following grading scale: + +- 90 and above: `"A"` +- 80–89: `"B"` +- 70–79: `"C"` +- 60–69: `"D"` +- below 60: `"F"` + +**Hint**: Make sure to use if/elif/else statements in the right order! diff --git a/fundamentals/grade_from_score/io.json b/fundamentals/grade-from-score/io.json similarity index 100% rename from fundamentals/grade_from_score/io.json rename to fundamentals/grade-from-score/io.json diff --git a/fundamentals/grade_from_score/meta.json b/fundamentals/grade-from-score/meta.json similarity index 100% rename from fundamentals/grade_from_score/meta.json rename to fundamentals/grade-from-score/meta.json diff --git a/fundamentals/grade_from_score/starter.py b/fundamentals/grade-from-score/starter.py similarity index 100% rename from fundamentals/grade_from_score/starter.py rename to fundamentals/grade-from-score/starter.py diff --git a/fundamentals/grade_from_score/description.md b/fundamentals/grade_from_score/description.md deleted file mode 100644 index 1b6169a7..00000000 --- a/fundamentals/grade_from_score/description.md +++ /dev/null @@ -1,9 +0,0 @@ -Write a function grade_from_score(score: int) -> str that takes an integer score between 0 and 100 (inclusive) and returns the corresponding letter grade as a string. Use the following grading scale: - -- 90 and above: "A" -- 80–89: "B" -- 70–79: "C" -- 60–69: "D" -- below 60: "F" - -**Hint**: Make sure to use if/elif/else statements in the right order! diff --git a/fundamentals/integer-conversion-loss/io.json b/fundamentals/integer-conversion-loss/io.json index c5cfc3bb..60773954 100644 --- a/fundamentals/integer-conversion-loss/io.json +++ b/fundamentals/integer-conversion-loss/io.json @@ -18,5 +18,25 @@ { "input": [42.01], "output": true + }, + { + "input": [50.000000001], + "output": true + }, + { + "input": [0.0], + "output": false + }, + { + "input": [110.5], + "output": true + }, + { + "input": [-30.07], + "output": true + }, + { + "input": [-55.57], + "output": true } ] diff --git a/fundamentals/is-even/io.json b/fundamentals/is-even/io.json index 837b3d51..36d40ba8 100644 --- a/fundamentals/is-even/io.json +++ b/fundamentals/is-even/io.json @@ -18,5 +18,25 @@ { "input": [13], "output": false + }, + { + "input": [100], + "output": true + }, + { + "input": [57], + "output": false + }, + { + "input": [-1000], + "output": true + }, + { + "input": [19], + "output": false + }, + { + "input": [20], + "output": true } ] diff --git a/fundamentals/is-multiple/io.json b/fundamentals/is-multiple/io.json index 96fa5b15..7885f254 100644 --- a/fundamentals/is-multiple/io.json +++ b/fundamentals/is-multiple/io.json @@ -18,5 +18,25 @@ { "input": [22, 4], "output": false + }, + { + "input": [-4, 2], + "output": true + }, + { + "input": [-6, -3], + "output": true + }, + { + "input": [8, -2], + "output": true + }, + { + "input": [10000, 10], + "output": true + }, + { + "input": [55, 10], + "output": false } ] diff --git a/fundamentals/makes-ten/io.json b/fundamentals/makes-ten/io.json index 37147f11..74d31768 100644 --- a/fundamentals/makes-ten/io.json +++ b/fundamentals/makes-ten/io.json @@ -18,5 +18,25 @@ { "input": [10, 10], "output": true + }, + { + "input": [-10, -10], + "output": false + }, + { + "input": [35, -25], + "output": true + }, + { + "input": [-55, 55], + "output": false + }, + { + "input": [-1, 11], + "output": true + }, + { + "input": [0, 0], + "output": false } ] diff --git a/fundamentals/minutes_to_seconds/description.md b/fundamentals/minutes-to-seconds/description.md similarity index 62% rename from fundamentals/minutes_to_seconds/description.md rename to fundamentals/minutes-to-seconds/description.md index 62cf4bec..be4a5256 100644 --- a/fundamentals/minutes_to_seconds/description.md +++ b/fundamentals/minutes-to-seconds/description.md @@ -1,3 +1 @@ Write a function `minutes_to_seconds(minutes: int) -> int` that takes a number of minutes and returns the equivalent number of seconds. - -There are 60 seconds in a minute, so if the input is 3, the output should be 180. diff --git a/fundamentals/minutes_to_seconds/io.json b/fundamentals/minutes-to-seconds/io.json similarity index 68% rename from fundamentals/minutes_to_seconds/io.json rename to fundamentals/minutes-to-seconds/io.json index e3e6e949..007ea368 100644 --- a/fundamentals/minutes_to_seconds/io.json +++ b/fundamentals/minutes-to-seconds/io.json @@ -26,5 +26,17 @@ { "input": [100], "output": 6000 + }, + { + "input": [-50], + "output": -3000 + }, + { + "input": [5], + "output": 300 + }, + { + "input": [50000], + "output": 3000000 } ] diff --git a/fundamentals/minutes_to_seconds/meta.json b/fundamentals/minutes-to-seconds/meta.json similarity index 100% rename from fundamentals/minutes_to_seconds/meta.json rename to fundamentals/minutes-to-seconds/meta.json diff --git a/fundamentals/minutes_to_seconds/starter.py b/fundamentals/minutes-to-seconds/starter.py similarity index 100% rename from fundamentals/minutes_to_seconds/starter.py rename to fundamentals/minutes-to-seconds/starter.py diff --git a/fundamentals/number_is_palindrome/description.md b/fundamentals/number-is-palindrome/description.md similarity index 63% rename from fundamentals/number_is_palindrome/description.md rename to fundamentals/number-is-palindrome/description.md index fbb3d043..4997e420 100644 --- a/fundamentals/number_is_palindrome/description.md +++ b/fundamentals/number-is-palindrome/description.md @@ -1,3 +1,7 @@ -Write a function `number_is_palindrome(n: int) -> bool` that takes a two-digit integer and returns `True` if it is a palindromic number — that is, the digits are the same (e.g. 11, 22, 33), and `False` otherwise. +Write a function `number_is_palindrome(n: int) -> bool` that takes a two-digit integer and returns `True` if it is a palindromic number — that is, the two digits are the same. + +For example: +- `number_is_palindrome(11) → True` +- `number_is_palindrome(56) → False` **Hint**: You may want to convert the number to a string or use arithmetic to extract the tens and ones digits. diff --git a/fundamentals/number_is_palindrome/io.json b/fundamentals/number-is-palindrome/io.json similarity index 70% rename from fundamentals/number_is_palindrome/io.json rename to fundamentals/number-is-palindrome/io.json index 73ec7da4..5bb5b310 100644 --- a/fundamentals/number_is_palindrome/io.json +++ b/fundamentals/number-is-palindrome/io.json @@ -7,10 +7,22 @@ "input": [22], "output": true }, + { + "input": [36], + "output": false + }, { "input": [44], "output": true }, + { + "input": [55], + "output": true + }, + { + "input": [67], + "output": false + }, { "input": [10], "output": false diff --git a/fundamentals/number_is_palindrome/meta.json b/fundamentals/number-is-palindrome/meta.json similarity index 100% rename from fundamentals/number_is_palindrome/meta.json rename to fundamentals/number-is-palindrome/meta.json diff --git a/fundamentals/number_is_palindrome/starter.py b/fundamentals/number-is-palindrome/starter.py similarity index 100% rename from fundamentals/number_is_palindrome/starter.py rename to fundamentals/number-is-palindrome/starter.py diff --git a/fundamentals/repeat-numbers/io.json b/fundamentals/repeat-numbers/io.json deleted file mode 100644 index f60207f8..00000000 --- a/fundamentals/repeat-numbers/io.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "input": [11], - "output": 11.11 - }, - { - "input": [5], - "output": 5.5 - }, - { - "input": [123], - "output": 123.123 - }, - { - "input": [0], - "output": 0.0 - }, - { - "input": [99], - "output": 99.99 - } -] diff --git a/fundamentals/repeat-numbers/description.md b/fundamentals/repeated-numbers/description.md similarity index 84% rename from fundamentals/repeat-numbers/description.md rename to fundamentals/repeated-numbers/description.md index 35268fb0..190ba157 100644 --- a/fundamentals/repeat-numbers/description.md +++ b/fundamentals/repeated-numbers/description.md @@ -1,5 +1,7 @@ Write a function `repeated_numbers(n: int) -> float` that takes an integer `n` as input and returns a floating-point number where the integer `n` is repeated in the decimal part. +**Note:** You can assume `n` will be positive. + For example: - `repeated_numbers(11) → 11.11` - `repeated_numbers(5) → 5.5` diff --git a/fundamentals/repeated-numbers/io.json b/fundamentals/repeated-numbers/io.json new file mode 100644 index 00000000..ff5a146c --- /dev/null +++ b/fundamentals/repeated-numbers/io.json @@ -0,0 +1,42 @@ +[ + { + "input": [11], + "output": 11.11 + }, + { + "input": [5], + "output": 5.5 + }, + { + "input": [123], + "output": 123.123 + }, + { + "input": [0], + "output": 0.0 + }, + { + "input": [99], + "output": 99.99 + }, + { + "input": [567], + "output": 567.567 + }, + { + "input": [10], + "output": 10.10 + }, + { + "input": [105], + "output": 105.105 + }, + { + "input": [22], + "output": 22.22 + }, + { + "input": [5005], + "output": 5005.5005 + } +] diff --git a/fundamentals/repeat-numbers/meta.json b/fundamentals/repeated-numbers/meta.json similarity index 100% rename from fundamentals/repeat-numbers/meta.json rename to fundamentals/repeated-numbers/meta.json diff --git a/fundamentals/repeat-numbers/starter.py b/fundamentals/repeated-numbers/starter.py similarity index 100% rename from fundamentals/repeat-numbers/starter.py rename to fundamentals/repeated-numbers/starter.py diff --git a/fundamentals/temperature-convert/description.md b/fundamentals/temperature-convert/description.md deleted file mode 100644 index eefd4df9..00000000 --- a/fundamentals/temperature-convert/description.md +++ /dev/null @@ -1,7 +0,0 @@ - -Write a function `temperature_convert(celsius: float) -> float` that converts a temperature from -Celsius to Fahrenheit. To calculate this conversion, we multiple the celsius value by 9/5 then add -32. - -For example: -- `temperature_convert(0.0) → 32.0`, as `0` degrees Celsius is equivalent to `32` degrees Fahrenheit. diff --git a/fundamentals/temperature-convert/io.json b/fundamentals/temperature-convert/io.json deleted file mode 100644 index 369c6c7d..00000000 --- a/fundamentals/temperature-convert/io.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "input": [0.0], - "output": 32.0 - }, - { - "input": [25.0], - "output": 77.0 - }, - { - "input": [-10.0], - "output": 14.0 - }, - { - "input": [100.0], - "output": 212.0 - }, - { - "input": [37.0], - "output": 98.6 - } -] diff --git a/fundamentals/temperature-convert/meta.json b/fundamentals/temperature-convert/meta.json deleted file mode 100644 index 31db88e0..00000000 --- a/fundamentals/temperature-convert/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Temperature Convert", - "name": "temperature_convert", - "difficulty": "easy", - "author": "ChatGPT", - "category": "Fundamentals", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/fundamentals/temperature-convert/starter.py b/fundamentals/temperature-convert/starter.py deleted file mode 100644 index 280f3a24..00000000 --- a/fundamentals/temperature-convert/starter.py +++ /dev/null @@ -1 +0,0 @@ -def temperature_convert(celsius: float) -> float: diff --git a/fundamentals/triangle-area/description.md b/fundamentals/triangle-area/description.md index d9d0d39c..754cfa33 100644 --- a/fundamentals/triangle-area/description.md +++ b/fundamentals/triangle-area/description.md @@ -1,7 +1,4 @@ - -Write a function `triangle_area(base: float, height: float) -> float` that calculates the area of a triangle given its base and height. The area of a triangle can be calculated using the formula: - -**Area = 1/2 x base x height.** +Write a function `triangle_area(base: float, height: float) -> float` that calculates the area of a triangle given its base and height. The area of a triangle can be calculated using the formula: `Area = 1/2 x base x height` For example: - `triangle_area(10.0, 5.0) → 25.0` because the area of the triangle is `0.5 * 10 * 5`. diff --git a/fundamentals/triangle-area/io.json b/fundamentals/triangle-area/io.json index ff53654f..cb60e5d2 100644 --- a/fundamentals/triangle-area/io.json +++ b/fundamentals/triangle-area/io.json @@ -18,5 +18,25 @@ { "input": [6.0, 6.0], "output": 18.0 + }, + { + "input": [5.0, 50.0], + "output": 125.0 + }, + { + "input": [555.0, 999.0], + "output": 277222.5 + }, + { + "input": [25.5, 78.5], + "output": 1000.875 + }, + { + "input": [50.0, 0.0], + "output": 0.0 + }, + { + "input": [10.0, 90.0], + "output": 450.0 } ] diff --git a/fundamentals/two-as-one/description.md b/fundamentals/two-as-one/description.md index fc7ccc3c..5fb4ef45 100644 --- a/fundamentals/two-as-one/description.md +++ b/fundamentals/two-as-one/description.md @@ -1,3 +1,5 @@ -Write a function `two_as_one(a: int, b: int, c: int) -> bool` that takes three integer inputs, `a`, `b`, and `c`. The function should return `True` if it is possible to add any two of the integers to get the third integer. +Write a function `two_as_one(a: int, b: int, c: int) -> bool` that takes three integer inputs, `a`, `b`, and `c`. The function should return `True` if it is possible to add any two of the integers to get the third integer. If none of these conditions are met, return `False`. -If none of these conditions are met, return `False`. For example, if the inputs are `2`, `3`, and `5`, the output should be `True` because `2 + 3 == 5`. If the inputs are `1`, `2`, and `4`, the output should be `False` because no two of the integers add up to the third. +For example: +- `two_as_one(2, 3, 5) → True` because `2 + 3 == 5` +- `two_as_one(1, 2, 4) → False` because no two of the integers add up to the third diff --git a/fundamentals/two-as-one/io.json b/fundamentals/two-as-one/io.json index 649a2f6c..082e0956 100644 --- a/fundamentals/two-as-one/io.json +++ b/fundamentals/two-as-one/io.json @@ -18,5 +18,25 @@ { "input": [8, 8, 15], "output": false + }, + { + "input": [0, 1, 10], + "output": false + }, + { + "input": [9, 19, 10], + "output": true + }, + { + "input": [50, 29, 21], + "output": true + }, + { + "input": [0, 0, 0], + "output": true + }, + { + "input": [5, 5, 5], + "output": false } ] From 74aec3a5ecb19d00af4c87da36c3098814f9d2af Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Wed, 15 Apr 2026 15:09:44 -0400 Subject: [PATCH 2/8] Add base code to all Fundamentals starter.py --- fundamentals/calculate-absolute/starter.py | 2 ++ fundamentals/decimal-match/starter.py | 2 ++ fundamentals/difference-is-even/starter.py | 2 ++ fundamentals/exactly-one-true/starter.py | 2 ++ fundamentals/extract-decimal/starter.py | 2 ++ fundamentals/grade-contribution/starter.py | 2 ++ fundamentals/grade-from-score/starter.py | 4 +++- fundamentals/integer-conversion-loss/starter.py | 2 ++ fundamentals/is-even/starter.py | 2 ++ fundamentals/is-multiple/starter.py | 2 ++ fundamentals/makes-ten/starter.py | 2 ++ fundamentals/minutes-to-seconds/starter.py | 2 ++ fundamentals/number-is-palindrome/starter.py | 2 ++ fundamentals/repeated-numbers/starter.py | 2 ++ fundamentals/triangle-area/starter.py | 2 ++ fundamentals/two-as-one/starter.py | 2 ++ logic/{alarm_clock => alarm-clock}/description.md | 0 logic/{alarm_clock => alarm-clock}/io.json | 0 logic/{alarm_clock => alarm-clock}/meta.json | 0 logic/{alarm_clock => alarm-clock}/starter.py | 0 20 files changed, 33 insertions(+), 1 deletion(-) rename logic/{alarm_clock => alarm-clock}/description.md (100%) rename logic/{alarm_clock => alarm-clock}/io.json (100%) rename logic/{alarm_clock => alarm-clock}/meta.json (100%) rename logic/{alarm_clock => alarm-clock}/starter.py (100%) diff --git a/fundamentals/calculate-absolute/starter.py b/fundamentals/calculate-absolute/starter.py index 79bd1a84..30e071e6 100644 --- a/fundamentals/calculate-absolute/starter.py +++ b/fundamentals/calculate-absolute/starter.py @@ -1 +1,3 @@ def calculate_absolute(n: int) -> int: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/decimal-match/starter.py b/fundamentals/decimal-match/starter.py index 726de80b..24aaaebf 100644 --- a/fundamentals/decimal-match/starter.py +++ b/fundamentals/decimal-match/starter.py @@ -1 +1,3 @@ def decimal_match(n: int, f: float) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/difference-is-even/starter.py b/fundamentals/difference-is-even/starter.py index 3ebc10b1..f13752e3 100644 --- a/fundamentals/difference-is-even/starter.py +++ b/fundamentals/difference-is-even/starter.py @@ -1 +1,3 @@ def difference_is_even(a: int, b: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/exactly-one-true/starter.py b/fundamentals/exactly-one-true/starter.py index 36f68aa7..cd22f5c9 100644 --- a/fundamentals/exactly-one-true/starter.py +++ b/fundamentals/exactly-one-true/starter.py @@ -1 +1,3 @@ def exactly_one_true(a: bool, b: bool, c: bool) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/extract-decimal/starter.py b/fundamentals/extract-decimal/starter.py index 7f9ce2e2..378f042e 100644 --- a/fundamentals/extract-decimal/starter.py +++ b/fundamentals/extract-decimal/starter.py @@ -1 +1,3 @@ def extract_decimal(f: float) -> float: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/grade-contribution/starter.py b/fundamentals/grade-contribution/starter.py index ece36299..f3a0079f 100644 --- a/fundamentals/grade-contribution/starter.py +++ b/fundamentals/grade-contribution/starter.py @@ -1 +1,3 @@ def grade_contribution(grade: float, weight: float) -> float: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/grade-from-score/starter.py b/fundamentals/grade-from-score/starter.py index 87c6885c..1234b5e3 100644 --- a/fundamentals/grade-from-score/starter.py +++ b/fundamentals/grade-from-score/starter.py @@ -1 +1,3 @@ -def grade_from_score(score: int) -> str: \ No newline at end of file +def grade_from_score(score: int) -> str: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/integer-conversion-loss/starter.py b/fundamentals/integer-conversion-loss/starter.py index 1b4aef68..d718d7f9 100644 --- a/fundamentals/integer-conversion-loss/starter.py +++ b/fundamentals/integer-conversion-loss/starter.py @@ -1 +1,3 @@ def integer_conversion_loss(n: float) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/is-even/starter.py b/fundamentals/is-even/starter.py index b80c361c..ae160874 100644 --- a/fundamentals/is-even/starter.py +++ b/fundamentals/is-even/starter.py @@ -1 +1,3 @@ def is_even(n: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/is-multiple/starter.py b/fundamentals/is-multiple/starter.py index a569071d..be64c8a2 100644 --- a/fundamentals/is-multiple/starter.py +++ b/fundamentals/is-multiple/starter.py @@ -1 +1,3 @@ def is_multiple(a: int, b: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/makes-ten/starter.py b/fundamentals/makes-ten/starter.py index 0398e0b6..9af44bb7 100644 --- a/fundamentals/makes-ten/starter.py +++ b/fundamentals/makes-ten/starter.py @@ -1 +1,3 @@ def makes_ten(a: int, b: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/minutes-to-seconds/starter.py b/fundamentals/minutes-to-seconds/starter.py index 6789645a..821d6205 100644 --- a/fundamentals/minutes-to-seconds/starter.py +++ b/fundamentals/minutes-to-seconds/starter.py @@ -1 +1,3 @@ def minutes_to_seconds(minutes: int) -> int: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/number-is-palindrome/starter.py b/fundamentals/number-is-palindrome/starter.py index a4074260..4dbb6075 100644 --- a/fundamentals/number-is-palindrome/starter.py +++ b/fundamentals/number-is-palindrome/starter.py @@ -1 +1,3 @@ def number_is_palindrome(n: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/repeated-numbers/starter.py b/fundamentals/repeated-numbers/starter.py index ab1b4849..44a70c3b 100644 --- a/fundamentals/repeated-numbers/starter.py +++ b/fundamentals/repeated-numbers/starter.py @@ -1 +1,3 @@ def repeated_numbers(n: int) -> float: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/triangle-area/starter.py b/fundamentals/triangle-area/starter.py index f47a09fc..80dcd7fa 100644 --- a/fundamentals/triangle-area/starter.py +++ b/fundamentals/triangle-area/starter.py @@ -1 +1,3 @@ def triangle_area(base: float, height: float) -> float: + # Your code here + pass \ No newline at end of file diff --git a/fundamentals/two-as-one/starter.py b/fundamentals/two-as-one/starter.py index c69bc5ee..71527c8e 100644 --- a/fundamentals/two-as-one/starter.py +++ b/fundamentals/two-as-one/starter.py @@ -1 +1,3 @@ def two_as_one(a: int, b: int, c: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/alarm_clock/description.md b/logic/alarm-clock/description.md similarity index 100% rename from logic/alarm_clock/description.md rename to logic/alarm-clock/description.md diff --git a/logic/alarm_clock/io.json b/logic/alarm-clock/io.json similarity index 100% rename from logic/alarm_clock/io.json rename to logic/alarm-clock/io.json diff --git a/logic/alarm_clock/meta.json b/logic/alarm-clock/meta.json similarity index 100% rename from logic/alarm_clock/meta.json rename to logic/alarm-clock/meta.json diff --git a/logic/alarm_clock/starter.py b/logic/alarm-clock/starter.py similarity index 100% rename from logic/alarm_clock/starter.py rename to logic/alarm-clock/starter.py From c92a713e16fd5f65915047a0745bfc5f8c73db1e Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Thu, 16 Apr 2026 10:13:31 -0400 Subject: [PATCH 3/8] Minor tweaks in fundamentals --- fundamentals/grade-contribution/io.json | 2 +- fundamentals/is-multiple/description.md | 4 +- .../number-is-palindrome/description.md | 7 ---- fundamentals/number-is-palindrome/io.json | 42 ------------------- fundamentals/number-is-palindrome/meta.json | 10 ----- fundamentals/number-is-palindrome/starter.py | 3 -- fundamentals/triangle-area/description.md | 7 +++- .../description.md | 0 .../io.json | 0 .../meta.json | 0 .../starter.py | 0 11 files changed, 8 insertions(+), 67 deletions(-) delete mode 100644 fundamentals/number-is-palindrome/description.md delete mode 100644 fundamentals/number-is-palindrome/io.json delete mode 100644 fundamentals/number-is-palindrome/meta.json delete mode 100644 fundamentals/number-is-palindrome/starter.py rename logic/{float-in-between => float-is-between}/description.md (100%) rename logic/{float-in-between => float-is-between}/io.json (100%) rename logic/{float-in-between => float-is-between}/meta.json (100%) rename logic/{float-in-between => float-is-between}/starter.py (100%) diff --git a/fundamentals/grade-contribution/io.json b/fundamentals/grade-contribution/io.json index 5a9b362b..1001660a 100644 --- a/fundamentals/grade-contribution/io.json +++ b/fundamentals/grade-contribution/io.json @@ -29,7 +29,7 @@ }, { "input": [32.0, 75.0], - "output": 28.0 + "output": 24.0 }, { "input": [40.0, 20.0], diff --git a/fundamentals/is-multiple/description.md b/fundamentals/is-multiple/description.md index ab26080c..c02ab5e7 100644 --- a/fundamentals/is-multiple/description.md +++ b/fundamentals/is-multiple/description.md @@ -1,7 +1,7 @@ -Write a function `is_multiple(a: int, b: int) -> bool` that takes two integers, `a` and `b`. The function should return `True` if `a` is a multiple of `b` (i.e., `a` divided by `b` has no remainder), and `False` otherwise. +Write a function `is_multiple(a: int, b: int) -> bool` that takes two integers, `a` and `b`. The function should return `True` if `a` is a multiple of `b`, and `False` otherwise. For example: - `is_multiple(10, 2) → True` because `10` is divisible by `2` -**Hint:** solve [is-even first](https://coding-cat.club/problems/is_even). +**Hint:** Solve [Is Even](https://coding-cat.club/#/problems/is_even) first, this is about having no remainder after a division. diff --git a/fundamentals/number-is-palindrome/description.md b/fundamentals/number-is-palindrome/description.md deleted file mode 100644 index 4997e420..00000000 --- a/fundamentals/number-is-palindrome/description.md +++ /dev/null @@ -1,7 +0,0 @@ -Write a function `number_is_palindrome(n: int) -> bool` that takes a two-digit integer and returns `True` if it is a palindromic number — that is, the two digits are the same. - -For example: -- `number_is_palindrome(11) → True` -- `number_is_palindrome(56) → False` - -**Hint**: You may want to convert the number to a string or use arithmetic to extract the tens and ones digits. diff --git a/fundamentals/number-is-palindrome/io.json b/fundamentals/number-is-palindrome/io.json deleted file mode 100644 index 5bb5b310..00000000 --- a/fundamentals/number-is-palindrome/io.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "input": [11], - "output": true - }, - { - "input": [22], - "output": true - }, - { - "input": [36], - "output": false - }, - { - "input": [44], - "output": true - }, - { - "input": [55], - "output": true - }, - { - "input": [67], - "output": false - }, - { - "input": [10], - "output": false - }, - { - "input": [42], - "output": false - }, - { - "input": [99], - "output": true - }, - { - "input": [21], - "output": false - } -] diff --git a/fundamentals/number-is-palindrome/meta.json b/fundamentals/number-is-palindrome/meta.json deleted file mode 100644 index cf586de0..00000000 --- a/fundamentals/number-is-palindrome/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Number Is Palindrome", - "name": "number_is_palindrome", - "difficulty": "medium", - "author": "ChatGPT", - "category": "Fundamentals", - "question_type": [ - "coding" - ] -} diff --git a/fundamentals/number-is-palindrome/starter.py b/fundamentals/number-is-palindrome/starter.py deleted file mode 100644 index 4dbb6075..00000000 --- a/fundamentals/number-is-palindrome/starter.py +++ /dev/null @@ -1,3 +0,0 @@ -def number_is_palindrome(n: int) -> bool: - # Your code here - pass \ No newline at end of file diff --git a/fundamentals/triangle-area/description.md b/fundamentals/triangle-area/description.md index 754cfa33..71eeeb93 100644 --- a/fundamentals/triangle-area/description.md +++ b/fundamentals/triangle-area/description.md @@ -1,4 +1,7 @@ -Write a function `triangle_area(base: float, height: float) -> float` that calculates the area of a triangle given its base and height. The area of a triangle can be calculated using the formula: `Area = 1/2 x base x height` +Write a function `triangle_area(base: float, height: float) -> float` that takes the `base` and `height` of a triangle as floats and calculates its area. + +The area of a triangle can be calculated using the formula: `Area = 1/2 x base x height` For example: -- `triangle_area(10.0, 5.0) → 25.0` because the area of the triangle is `0.5 * 10 * 5`. +- `triangle_area(10.0, 5.0) → 25.0` as `1/2 x 10 x 5`. +- `triangle_area(7.0, 3.0) → 10.5` as `1/2 x 7 x 3`. diff --git a/logic/float-in-between/description.md b/logic/float-is-between/description.md similarity index 100% rename from logic/float-in-between/description.md rename to logic/float-is-between/description.md diff --git a/logic/float-in-between/io.json b/logic/float-is-between/io.json similarity index 100% rename from logic/float-in-between/io.json rename to logic/float-is-between/io.json diff --git a/logic/float-in-between/meta.json b/logic/float-is-between/meta.json similarity index 100% rename from logic/float-in-between/meta.json rename to logic/float-is-between/meta.json diff --git a/logic/float-in-between/starter.py b/logic/float-is-between/starter.py similarity index 100% rename from logic/float-in-between/starter.py rename to logic/float-is-between/starter.py From 1323792b342520cd889f1d1109debab259931b58 Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Thu, 16 Apr 2026 10:14:31 -0400 Subject: [PATCH 4/8] Remove 4 problems and add more test cases to Logic --- logic/alarm-clock/description.md | 10 +++---- logic/alarm-clock/io.json | 12 +++++++++ logic/alarm-clock/starter.py | 4 ++- logic/answer-call/description.md | 5 ++-- logic/answer-call/io.json | 12 +++++++++ logic/answer-call/starter.py | 2 ++ logic/any-two-equal/io.json | 21 ++++++++++++++- logic/any-two-equal/starter.py | 2 ++ logic/boolean-xnor/description.md | 3 ++- logic/boolean-xnor/starter.py | 2 ++ logic/boolean-xor/description.md | 5 ++-- logic/boolean-xor/meta.json | 2 +- logic/boolean-xor/starter.py | 2 ++ logic/close-or-equal/description.md | 6 ----- logic/close-or-equal/io.json | 26 ------------------ logic/close-or-equal/meta.json | 10 ------- logic/close-or-equal/starter.py | 1 - logic/dating-filter/description.md | 3 --- logic/dating-filter/io.json | 22 --------------- logic/dating-filter/meta.json | 10 ------- logic/dating-filter/starter.py | 1 - logic/eat-outside/description.md | 4 --- logic/eat-outside/io.json | 5 ---- logic/eat-outside/meta.json | 10 ------- logic/eat-outside/starter.py | 2 -- logic/float-is-between/description.md | 4 +-- logic/float-is-between/io.json | 12 +++++++++ logic/float-is-between/meta.json | 2 +- logic/float-is-between/starter.py | 4 ++- logic/greater-difference/description.md | 1 - logic/greater-difference/io.json | 18 ------------- logic/greater-difference/meta.json | 10 ------- logic/greater-difference/starter.py | 2 -- logic/greater-than-double/description.md | 2 +- logic/greater-than-double/io.json | 12 +++++++++ logic/greater-than-double/starter.py | 2 ++ logic/in-order/description.md | 2 +- logic/in-order/io.json | 22 ++++++++++++++- logic/in-order/starter.py | 2 ++ logic/int-bool-equality/description.md | 10 +++---- logic/int-bool-equality/starter.py | 2 ++ logic/intersecting-metro/description.md | 4 --- logic/intersecting-metro/io.json | 8 ------ logic/intersecting-metro/meta.json | 10 ------- logic/intersecting-metro/starter.py | 2 -- logic/is-century-year/description.md | 5 ---- logic/is-century-year/io.json | 34 ------------------------ logic/is-century-year/meta.json | 10 ------- logic/is-century-year/starter.py | 1 - logic/majority-wins/description.md | 2 +- logic/majority-wins/io.json | 8 ++++++ logic/majority-wins/starter.py | 4 ++- logic/palindrome-number/description.md | 11 ++++---- logic/palindrome-number/io.json | 16 +++++++++++ logic/palindrome-number/starter.py | 4 ++- logic/power-of-two/description.md | 7 ----- logic/power-of-two/io.json | 34 ------------------------ logic/power-of-two/meta.json | 10 ------- logic/power-of-two/starter.py | 1 - logic/pyramid-problem/description.md | 18 +++++-------- logic/pyramid-problem/io.json | 26 +++++++++++++++--- logic/pyramid-problem/starter.py | 4 ++- logic/two-or-three/description.md | 7 +++-- logic/two-or-three/io.json | 12 +++++++++ logic/two-or-three/starter.py | 4 ++- 65 files changed, 221 insertions(+), 310 deletions(-) delete mode 100644 logic/close-or-equal/description.md delete mode 100644 logic/close-or-equal/io.json delete mode 100644 logic/close-or-equal/meta.json delete mode 100644 logic/close-or-equal/starter.py delete mode 100644 logic/dating-filter/description.md delete mode 100644 logic/dating-filter/io.json delete mode 100644 logic/dating-filter/meta.json delete mode 100644 logic/dating-filter/starter.py delete mode 100644 logic/eat-outside/description.md delete mode 100644 logic/eat-outside/io.json delete mode 100644 logic/eat-outside/meta.json delete mode 100644 logic/eat-outside/starter.py delete mode 100644 logic/greater-difference/description.md delete mode 100644 logic/greater-difference/io.json delete mode 100644 logic/greater-difference/meta.json delete mode 100644 logic/greater-difference/starter.py delete mode 100644 logic/intersecting-metro/description.md delete mode 100644 logic/intersecting-metro/io.json delete mode 100644 logic/intersecting-metro/meta.json delete mode 100644 logic/intersecting-metro/starter.py delete mode 100644 logic/is-century-year/description.md delete mode 100644 logic/is-century-year/io.json delete mode 100644 logic/is-century-year/meta.json delete mode 100644 logic/is-century-year/starter.py delete mode 100644 logic/power-of-two/description.md delete mode 100644 logic/power-of-two/io.json delete mode 100644 logic/power-of-two/meta.json delete mode 100644 logic/power-of-two/starter.py diff --git a/logic/alarm-clock/description.md b/logic/alarm-clock/description.md index dc43cf07..67686370 100644 --- a/logic/alarm-clock/description.md +++ b/logic/alarm-clock/description.md @@ -1,8 +1,8 @@ -Write a function `alarm_clock(day: int, vacation: bool) -> str` that takes in a day of the week (encoded as 0=Sunday, 1=Monday, ..., 6=Saturday) and a boolean indicating whether or not you are on vacation. The function should return a string representing what time the alarm should ring. +Write a function `alarm_clock(day: int, vacation: bool) -> str` that takes in an int `day` representing day of the week (encoded as `0` = Sunday, `1` = Monday, ..., `6` = Saturday) and a boolean `vacation` indicating whether or not you are on vacation. The function should return a string representing what time the alarm should ring. The alarm clock rules are: -- On weekdays (Monday–Friday), the alarm should be "7:00". -- On weekends (Saturday and Sunday), the alarm should be "10:00". +- On weekdays (Monday–Friday), the alarm should be `"7:00"`. +- On weekends (Saturday and Sunday), the alarm should be `"10:00"`. - If you are on vacation: - - Weekdays: "10:00" - - Weekends: "off" + - Weekdays: `"10:00"` + - Weekends: `"off"` diff --git a/logic/alarm-clock/io.json b/logic/alarm-clock/io.json index f9d9b9e8..bd07d711 100644 --- a/logic/alarm-clock/io.json +++ b/logic/alarm-clock/io.json @@ -26,5 +26,17 @@ { "input": [6, true], "output": "off" + }, + { + "input": [4, false], + "output": "7:00" + }, + { + "input": [4, true], + "output": "10:00" + }, + { + "input": [2, false], + "output": "7:00" } ] diff --git a/logic/alarm-clock/starter.py b/logic/alarm-clock/starter.py index 3a0cbbf2..6214476a 100644 --- a/logic/alarm-clock/starter.py +++ b/logic/alarm-clock/starter.py @@ -1 +1,3 @@ -def alarm_clock(day: int, vacation: bool) -> str: \ No newline at end of file +def alarm_clock(day: int, vacation: bool) -> str: + # Your code here + pass \ No newline at end of file diff --git a/logic/answer-call/description.md b/logic/answer-call/description.md index 4c0f10f5..2c207460 100644 --- a/logic/answer-call/description.md +++ b/logic/answer-call/description.md @@ -1,8 +1,7 @@ +Write a function `answer_call(morning: bool, mom: bool, is_asleep: bool) -> bool` that determines whether you should answer your cell phone based on the following conditions: -Write a function `answer_cell(morning: bool, mom: bool, is_asleep: bool) -> bool` that determines whether you should answer your cell phone based on the following conditions: - -- Normally, you answer the phone except when you are asleep. - In the morning, you only answer if it is your mom calling. +- Otherwise, you answer the phone except when you are asleep. - If you are asleep, you do not answer the phone regardless of the time or who is calling. Return `True` if you should answer the phone and `False` otherwise. diff --git a/logic/answer-call/io.json b/logic/answer-call/io.json index 1bfd7547..5ae8ea07 100644 --- a/logic/answer-call/io.json +++ b/logic/answer-call/io.json @@ -18,5 +18,17 @@ { "input": [false, true, true], "output": false + }, + { + "input": [true, true, true], + "output": false + }, + { + "input": [false, true, false], + "output": true + }, + { + "input": [true, false, true], + "output": false } ] diff --git a/logic/answer-call/starter.py b/logic/answer-call/starter.py index 4e0a8ae6..85711420 100644 --- a/logic/answer-call/starter.py +++ b/logic/answer-call/starter.py @@ -1 +1,3 @@ def answer_call(morning: bool, mom: bool, is_asleep: bool) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/any-two-equal/io.json b/logic/any-two-equal/io.json index d1ba3867..ccfa13e2 100644 --- a/logic/any-two-equal/io.json +++ b/logic/any-two-equal/io.json @@ -1,4 +1,3 @@ - [ { "input": [3, 3, 4], @@ -19,5 +18,25 @@ { "input": [7, 8, 9], "output": false + }, + { + "input": [-5, -2, -5], + "output": true + }, + { + "input": [-10, 10, 9], + "output": false + }, + { + "input": [1000, 1000, 999], + "output": true + }, + { + "input": [10, 10, 10], + "output": true + }, + { + "input": [0, 9, 8], + "output": false } ] diff --git a/logic/any-two-equal/starter.py b/logic/any-two-equal/starter.py index cf5e7cf1..66db6231 100644 --- a/logic/any-two-equal/starter.py +++ b/logic/any-two-equal/starter.py @@ -1 +1,3 @@ def any_two_equal(a: int, b: int, c: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/boolean-xnor/description.md b/logic/boolean-xnor/description.md index b931ab06..279ba33b 100644 --- a/logic/boolean-xnor/description.md +++ b/logic/boolean-xnor/description.md @@ -1,3 +1,4 @@ Write a function `boolean_xnor(a: bool, b: bool) -> bool` that takes two boolean inputs, `a` and `b`. The function should return the result of the exclusive NOR (XNOR) operation on these inputs. In other words, the function should return `True` if both inputs are the same (both `True` or both `False`), and `False` otherwise. -For example, if the inputs are `True` and `False`, the output should be `False` because the inputs are different. +For example: +- `boolean_xnor(True, False) → False` because the inputs are different. diff --git a/logic/boolean-xnor/starter.py b/logic/boolean-xnor/starter.py index f53da880..e85f0ba9 100644 --- a/logic/boolean-xnor/starter.py +++ b/logic/boolean-xnor/starter.py @@ -1 +1,3 @@ def boolean_xnor(a: bool, b: bool) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/boolean-xor/description.md b/logic/boolean-xor/description.md index 3135a137..10a9bcd6 100644 --- a/logic/boolean-xor/description.md +++ b/logic/boolean-xor/description.md @@ -1,3 +1,4 @@ -Write a function `boolean_xor(a: bool, b: bool) -> bool` that takes two boolean inputs, `a` and `b`. The function should return the result of the exclusive OR (XOR) operation on these inputs. In other words, the function should return `True` if exactly one of the inputs is `True` (but not both) and `False` otherwise. +Write a function `boolean_xor(a: bool, b: bool) -> bool` that takes two boolean inputs, `a` and `b`. The function should return the result of the exclusive OR (XOR) operation on these inputs. In other words, the function should return `True` if exactly one of the inputs is `True` (but not both) and `False` otherwise. -For example, if the inputs are `True` and `False`, the output should be `True` because only one of the inputs is `True`. +For example: +- `boolean_xor(True, False) → True` because only one of the inputs is `True`. diff --git a/logic/boolean-xor/meta.json b/logic/boolean-xor/meta.json index 85c6b3e3..76ce8ae3 100644 --- a/logic/boolean-xor/meta.json +++ b/logic/boolean-xor/meta.json @@ -1,7 +1,7 @@ { "title": "Boolean XOR", "name": "boolean_xor", - "difficulty": "medium", + "difficulty": "easy", "author": "ChatGPT", "category": "Logic", "question_type": [ diff --git a/logic/boolean-xor/starter.py b/logic/boolean-xor/starter.py index 3b948ed0..858880b9 100644 --- a/logic/boolean-xor/starter.py +++ b/logic/boolean-xor/starter.py @@ -1 +1,3 @@ def boolean_xor(a: bool, b: bool) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/close-or-equal/description.md b/logic/close-or-equal/description.md deleted file mode 100644 index 76df1312..00000000 --- a/logic/close-or-equal/description.md +++ /dev/null @@ -1,6 +0,0 @@ -Write a function `close_or_equal(a: int, b: int) -> bool` that takes two integer inputs, `a` and `b`. The function should return `True` if the two numbers are exactly equal or if their absolute difference is `1` or less. - -In other words, it should return `True` if `a == b`, `a == b + 1`, or `a == b - 1`; otherwise, it should return `False`. - -For example: -- `close_or_equal(5, 6) → True` diff --git a/logic/close-or-equal/io.json b/logic/close-or-equal/io.json deleted file mode 100644 index 2a9ae9d0..00000000 --- a/logic/close-or-equal/io.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "input": [5, 6], - "output": true - }, - { - "input": [10, 10], - "output": true - }, - { - "input": [0, 2], - "output": false - }, - { - "input": [-3, -4], - "output": true - }, - { - "input": [100, 99], - "output": true - }, - { - "input": [7, 9], - "output": false - } -] diff --git a/logic/close-or-equal/meta.json b/logic/close-or-equal/meta.json deleted file mode 100644 index 87c7fde4..00000000 --- a/logic/close-or-equal/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Close or Equal", - "name": "close_or_equal", - "difficulty": "medium", - "author": "ChatGPT", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/close-or-equal/starter.py b/logic/close-or-equal/starter.py deleted file mode 100644 index 088847e0..00000000 --- a/logic/close-or-equal/starter.py +++ /dev/null @@ -1 +0,0 @@ -def close_or_equal(a: int, b: int) -> bool: diff --git a/logic/dating-filter/description.md b/logic/dating-filter/description.md deleted file mode 100644 index 2600bdd9..00000000 --- a/logic/dating-filter/description.md +++ /dev/null @@ -1,3 +0,0 @@ -Write a function `dating_filter(height: float, eye_color: str, job: str) -> bool` that takes three inputs: `height` (a float representing the height in feet), `eye_color` (a string representing the color of the eyes), and `job` (a string representing the job). - -The function should return `True` if the inputs match the criteria of "6 foot" height, "blue" eyes, and "finance" job. Otherwise, it should return `False`. For example, if the inputs are `6.0`, `"blue"`, and `"finance"`, the output should be `True`. diff --git a/logic/dating-filter/io.json b/logic/dating-filter/io.json deleted file mode 100644 index a5e440e7..00000000 --- a/logic/dating-filter/io.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "input": [6.0, "blue", "finance"], - "output": true - }, - { - "input": [5.8, "blue", "finance"], - "output": false - }, - { - "input": [6.0, "green", "finance"], - "output": false - }, - { - "input": [6.0, "blue", "engineer"], - "output": false - }, - { - "input": [6.0, "blue", "finance"], - "output": true - } -] diff --git a/logic/dating-filter/meta.json b/logic/dating-filter/meta.json deleted file mode 100644 index fd32c0b0..00000000 --- a/logic/dating-filter/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Dating Filter", - "name": "dating_filter", - "difficulty": "easy", - "author": "ChatGPT", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/dating-filter/starter.py b/logic/dating-filter/starter.py deleted file mode 100644 index 53a42cb5..00000000 --- a/logic/dating-filter/starter.py +++ /dev/null @@ -1 +0,0 @@ -def dating_filter(height: float, eye_color: str, job: str) -> bool: diff --git a/logic/eat-outside/description.md b/logic/eat-outside/description.md deleted file mode 100644 index d8f1ded3..00000000 --- a/logic/eat-outside/description.md +++ /dev/null @@ -1,4 +0,0 @@ -Dawson is lucky in that we have a lot of greenspace in downtown Montreal. However, just because we have a nice campus doesn't mean it's always the best to go outside. - -Write a function that determines is it's a good idea to eat outside. Return `true` if it is summer and not raining, otherwise return `false`. - diff --git a/logic/eat-outside/io.json b/logic/eat-outside/io.json deleted file mode 100644 index 20bb0d49..00000000 --- a/logic/eat-outside/io.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - { "input": [true, true], "output": false }, - { "input": [true, false], "output": false }, - { "input": [false, true], "output": true } -] diff --git a/logic/eat-outside/meta.json b/logic/eat-outside/meta.json deleted file mode 100644 index e4b0dc1b..00000000 --- a/logic/eat-outside/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Eat outside?", - "name": "eat_outside", - "difficulty": "easy", - "author": "Eric Mayhew", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/eat-outside/starter.py b/logic/eat-outside/starter.py deleted file mode 100644 index d70a7ee3..00000000 --- a/logic/eat-outside/starter.py +++ /dev/null @@ -1,2 +0,0 @@ -def eat_outside(raining: bool, summer: bool) -> bool: - return False diff --git a/logic/float-is-between/description.md b/logic/float-is-between/description.md index fd5aebea..2636636c 100644 --- a/logic/float-is-between/description.md +++ b/logic/float-is-between/description.md @@ -1,4 +1,4 @@ -Write a function `float_in_between(x: float, y: float, z: float) -> bool` that returns `True` if `x` is strictly between `y` and `z` (i.e., greater than the smaller of the two and less than the larger), and `False` otherwise. +Write a function `float_is_between(x: float, y: float, z: float) -> bool` that returns `True` if `x` is strictly between `y` and `z` (i.e., greater than the smaller of the two and less than the larger), and `False` otherwise. For example: -- `float_in_between(5.0, 3.0, 8.0) → True` → `5.0` is between `3.0` and `8.0`. +- `float_is_between(5.0, 3.0, 8.0) → True` → `5.0` is between `3.0` and `8.0`. diff --git a/logic/float-is-between/io.json b/logic/float-is-between/io.json index 5d1f9532..4bd2e4b7 100644 --- a/logic/float-is-between/io.json +++ b/logic/float-is-between/io.json @@ -26,5 +26,17 @@ { "input": [3.0, 5.0, 2.0], "output": true + }, + { + "input": [-3.0, -10.0, 0.0], + "output": true + }, + { + "input": [0.0, 5.0, -5.0], + "output": true + }, + { + "input": [100.0, -99.0, -101.0], + "output": false } ] diff --git a/logic/float-is-between/meta.json b/logic/float-is-between/meta.json index 0d739851..5afe19bf 100644 --- a/logic/float-is-between/meta.json +++ b/logic/float-is-between/meta.json @@ -1,6 +1,6 @@ { "title": "Float Is Between", - "name": "is_between", + "name": "float_is_between", "difficulty": "easy", "author": "ChatGPT", "category": "Logic", diff --git a/logic/float-is-between/starter.py b/logic/float-is-between/starter.py index 78b6087f..7ff07f6f 100644 --- a/logic/float-is-between/starter.py +++ b/logic/float-is-between/starter.py @@ -1 +1,3 @@ -def is_between(x: float, y: float, z: float) -> bool: +def float_is_between(x: float, y: float, z: float) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/greater-difference/description.md b/logic/greater-difference/description.md deleted file mode 100644 index d6591e41..00000000 --- a/logic/greater-difference/description.md +++ /dev/null @@ -1 +0,0 @@ -Write a function `greater_difference(a: int, b: int, c: int) -> bool` that takes three integer inputs: `a`, `b`, and `c`. The function should return `True` if the absolute difference between `a` and `b` is greater than `c`, and `False` otherwise. diff --git a/logic/greater-difference/io.json b/logic/greater-difference/io.json deleted file mode 100644 index 82f24550..00000000 --- a/logic/greater-difference/io.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "input": [5, 3, 1], - "output": true - }, - { - "input": [4, 8, 3], - "output": true - }, - { - "input": [10, 2, 7], - "output": true - }, - { - "input": [1, 1, 0], - "output": false - } -] diff --git a/logic/greater-difference/meta.json b/logic/greater-difference/meta.json deleted file mode 100644 index 0b63f61a..00000000 --- a/logic/greater-difference/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Greater Difference", - "name": "greater_difference", - "difficulty": "easy", - "author": "ChatGPT", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/greater-difference/starter.py b/logic/greater-difference/starter.py deleted file mode 100644 index de3f9bb4..00000000 --- a/logic/greater-difference/starter.py +++ /dev/null @@ -1,2 +0,0 @@ -def greater_difference(a: int, b: int, c: int) -> bool: - # Your code here diff --git a/logic/greater-than-double/description.md b/logic/greater-than-double/description.md index 6e697b3c..3fa830b8 100644 --- a/logic/greater-than-double/description.md +++ b/logic/greater-than-double/description.md @@ -1,4 +1,4 @@ -Write a function `greater_than_double(a: int, b: int) -> bool` that takes two integer inputs, `a` and `b`. The function should return `True` if one of the numbers is greater than double the other number. +Write a function `greater_than_double(a: int, b: int) -> bool` that takes two integer inputs, `a` and `b`. The function should return `True` if one of the numbers is greater than (not equal to) double the other number. For example: - `greater_than_double(5, 12) → True` because `12` is greater than double `5`. diff --git a/logic/greater-than-double/io.json b/logic/greater-than-double/io.json index 69b41f1e..a1482299 100644 --- a/logic/greater-than-double/io.json +++ b/logic/greater-than-double/io.json @@ -26,5 +26,17 @@ { "input": [7, 14], "output": false + }, + { + "input": [-5, 1], + "output": true + }, + { + "input": [0, 0], + "output": false + }, + { + "input": [0, 1], + "output": true } ] diff --git a/logic/greater-than-double/starter.py b/logic/greater-than-double/starter.py index eb3cc30f..afd78809 100644 --- a/logic/greater-than-double/starter.py +++ b/logic/greater-than-double/starter.py @@ -1 +1,3 @@ def greater_than_double(a: int, b: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/in-order/description.md b/logic/in-order/description.md index e1c7effc..b1bf01d5 100644 --- a/logic/in-order/description.md +++ b/logic/in-order/description.md @@ -1,4 +1,4 @@ -Write a function `in_order(a: int, b: int, c: int) -> bool` that takes three integer inputs, `a`, `b`, and `c`. The function should return `True` if the integers are in strictly increasing order (i.e., `a` < `b` < `c`). If the integers are not in increasing order, return `False`. +Write a function `in_order(a: int, b: int, c: int) -> bool` that takes three integer inputs, `a`, `b`, and `c`. The function should return `True` if the integers are in strictly increasing order, otherwise return `False`. For example: - `in_order(1, 2, 3)` → `True` diff --git a/logic/in-order/io.json b/logic/in-order/io.json index 795597a9..aee7035c 100644 --- a/logic/in-order/io.json +++ b/logic/in-order/io.json @@ -16,7 +16,27 @@ "output": false }, { - "input": [7, 8, 7], + "input": [-20, 0, 1], + "output": true + }, + { + "input": [0, 0, 1], "output": false + }, + { + "input": [-100, -95, -90], + "output": true + }, + { + "input": [2, 8, 8], + "output": false + }, + { + "input": [10, 9, 8], + "output": false + }, + { + "input": [111, 222, 333], + "output": true } ] diff --git a/logic/in-order/starter.py b/logic/in-order/starter.py index f0c734e1..f7cdf72a 100644 --- a/logic/in-order/starter.py +++ b/logic/in-order/starter.py @@ -1 +1,3 @@ def in_order(a: int, b: int, c: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/int-bool-equality/description.md b/logic/int-bool-equality/description.md index 4a21545a..e5bb58bc 100644 --- a/logic/int-bool-equality/description.md +++ b/logic/int-bool-equality/description.md @@ -1,7 +1,7 @@ -Write a function `int_bool_equality(n: int, b: bool) -> bool` that takes an integer `n` and a boolean `b` as inputs. The function should return `True` if the integer `n` is equal to `1` when `b` is `True` and equal to `0` when `b` is `False`. +Write a function `int_bool_equality(n: int, b: bool) -> bool` that takes an integer `n` and a boolean `b` as inputs. The function should return `True` if the integer `n` is `1` when `b` is `True`, as well as if `n` is `0` when `b` is `False`. For example: -- `int_bool_equality(1, True)` → `True` -- `int_bool_equality(0, False)` → `True` -- `int_bool_equality(1, False)` → `False` -- `int_bool_equality(0, True)` → `False` +- `int_bool_equality(1, True) → True` +- `int_bool_equality(0, False) → True` +- `int_bool_equality(1, False) → False` +- `int_bool_equality(0, True) → False` diff --git a/logic/int-bool-equality/starter.py b/logic/int-bool-equality/starter.py index 790e17eb..84108610 100644 --- a/logic/int-bool-equality/starter.py +++ b/logic/int-bool-equality/starter.py @@ -1 +1,3 @@ def int_bool_equality(n: int, b: bool) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/intersecting-metro/description.md b/logic/intersecting-metro/description.md deleted file mode 100644 index daf674c2..00000000 --- a/logic/intersecting-metro/description.md +++ /dev/null @@ -1,4 +0,0 @@ -You need to write a program that identifies whether a metro stop on the STM is an interchange station or not. - -We consider a metro stop an "interchange station" if two or more metro lines intersect there, such as Lionel-Groulx. - diff --git a/logic/intersecting-metro/io.json b/logic/intersecting-metro/io.json deleted file mode 100644 index f9acd984..00000000 --- a/logic/intersecting-metro/io.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { "input": ["Lionel-Groulx"], "output": true }, - { "input": ["Snowdon"], "output": true }, - { "input": ["Berri-UQAM"], "output": true }, - { "input": ["Atwater"], "output": false }, - { "input": ["Verdun"], "output": false }, - { "input": ["Villa-Maria"], "output": false } -] diff --git a/logic/intersecting-metro/meta.json b/logic/intersecting-metro/meta.json deleted file mode 100644 index 4f6e2a57..00000000 --- a/logic/intersecting-metro/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Intersecting metro?", - "name": "intersecting_metro", - "difficulty": "easy", - "author": "Eric Mayhew", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/intersecting-metro/starter.py b/logic/intersecting-metro/starter.py deleted file mode 100644 index 3f361b73..00000000 --- a/logic/intersecting-metro/starter.py +++ /dev/null @@ -1,2 +0,0 @@ -def intersecting_metro(station_name: str) -> bool: - return True diff --git a/logic/is-century-year/description.md b/logic/is-century-year/description.md deleted file mode 100644 index eb1a4918..00000000 --- a/logic/is-century-year/description.md +++ /dev/null @@ -1,5 +0,0 @@ -Write a function `is_century_year(year: int) -> bool` that returns True if the given year is a "century year", meaning it ends in "00". - -For example: -- 1900 and 2000 are century years. -- 1999 and 2024 are not. diff --git a/logic/is-century-year/io.json b/logic/is-century-year/io.json deleted file mode 100644 index 2eac23ad..00000000 --- a/logic/is-century-year/io.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "input": [1900], - "output": true - }, - { - "input": [2000], - "output": true - }, - { - "input": [1800], - "output": true - }, - { - "input": [1999], - "output": false - }, - { - "input": [2023], - "output": false - }, - { - "input": [101], - "output": false - }, - { - "input": [0], - "output": true - }, - { - "input": [-100], - "output": true - } -] \ No newline at end of file diff --git a/logic/is-century-year/meta.json b/logic/is-century-year/meta.json deleted file mode 100644 index 3e62b9a7..00000000 --- a/logic/is-century-year/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Is Century Year", - "name": "is_century_year", - "difficulty": "easy", - "author": "ChatGPT", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/is-century-year/starter.py b/logic/is-century-year/starter.py deleted file mode 100644 index 6c7605c6..00000000 --- a/logic/is-century-year/starter.py +++ /dev/null @@ -1 +0,0 @@ -def is_century_year(year: int) -> bool: \ No newline at end of file diff --git a/logic/majority-wins/description.md b/logic/majority-wins/description.md index 1e0abc8e..0547a66d 100644 --- a/logic/majority-wins/description.md +++ b/logic/majority-wins/description.md @@ -1,5 +1,5 @@ Write a function `majority_wins(a: bool, b: bool, c: bool) -> bool` that takes in three boolean values and returns the value that appears at least twice. -In other words, return True if two or more of the inputs are True, and return False if two or more are False. +In other words, return `True` if two or more of the inputs are `True`, and return `False` if two or more are `False`. **Hint**: You can convert booleans to integers to help count them. diff --git a/logic/majority-wins/io.json b/logic/majority-wins/io.json index 7923fe94..8106a773 100644 --- a/logic/majority-wins/io.json +++ b/logic/majority-wins/io.json @@ -7,6 +7,14 @@ "input": [false, false, true], "output": false }, + { + "input": [false, true, true], + "output": true + }, + { + "input": [true, false, false], + "output": false + }, { "input": [true, false, true], "output": true diff --git a/logic/majority-wins/starter.py b/logic/majority-wins/starter.py index eb0abdec..1748079d 100644 --- a/logic/majority-wins/starter.py +++ b/logic/majority-wins/starter.py @@ -1 +1,3 @@ -def majority_wins(a: bool, b: bool, c: bool) -> bool: \ No newline at end of file +def majority_wins(a: bool, b: bool, c: bool) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/palindrome-number/description.md b/logic/palindrome-number/description.md index 5bb9dd43..c96e3531 100644 --- a/logic/palindrome-number/description.md +++ b/logic/palindrome-number/description.md @@ -1,9 +1,8 @@ -Write a function `palindrome_number(n: int) -> bool` that returns True if the integer n is a palindrome, and False otherwise. -A palindrome is a number that reads the same forwards and backwards. +Write a function `palindrome_number(n: int) -> bool` that returns `True` if the integer `n` is a palindrome, and `False` otherwise. A palindrome is a number that reads the same forwards and backwards. Negative numbers are **not** considered palindromes. For example: -- 121 is a palindrome -- 1331 is a palindrome -- 123 is not a palindrome +- `palindrome_number(121) → True` +- `palindrome_number(1331) → True` +- `palindrome_number(123) → False` -**Hint**: You can convert the number to a string to easily reverse and compare it. Negative numbers are not considered palindromes. +**Hint**: You can convert the number to a string to easily reverse and compare it. You may want to research how to reverse strings in Python. diff --git a/logic/palindrome-number/io.json b/logic/palindrome-number/io.json index 5b6391b3..858459ad 100644 --- a/logic/palindrome-number/io.json +++ b/logic/palindrome-number/io.json @@ -3,6 +3,10 @@ "input": [121], "output": true }, + { + "input": [1331], + "output": true + }, { "input": [123], "output": false @@ -22,5 +26,17 @@ { "input": [-121], "output": false + }, + { + "input": [2332], + "output": true + }, + { + "input": [556676655], + "output": true + }, + { + "input": [5050], + "output": false } ] \ No newline at end of file diff --git a/logic/palindrome-number/starter.py b/logic/palindrome-number/starter.py index 04f6e41f..a106fda8 100644 --- a/logic/palindrome-number/starter.py +++ b/logic/palindrome-number/starter.py @@ -1 +1,3 @@ -def palindrome_number(n: int) -> bool: \ No newline at end of file +def palindrome_number(n: int) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/logic/power-of-two/description.md b/logic/power-of-two/description.md deleted file mode 100644 index 1374f4a8..00000000 --- a/logic/power-of-two/description.md +++ /dev/null @@ -1,7 +0,0 @@ -Write a function `power_of_two(n: int) -> bool` that takes an integer n and returns True if it is a power of 2, and False otherwise. - -A number is a power of 2 if it can be written as 2^k for some non-negative integer k. For example: -- 1 (2^0), 2 (2^1), 4 (2^2), 8 (2^3), etc. are all powers of 2. -- 0, 3, 6, 10, etc. are not. - -**Hint**: Use a loop to check if the number is a power of 2. diff --git a/logic/power-of-two/io.json b/logic/power-of-two/io.json deleted file mode 100644 index e7fe83e7..00000000 --- a/logic/power-of-two/io.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "input": [1], - "output": true - }, - { - "input": [2], - "output": true - }, - { - "input": [3], - "output": false - }, - { - "input": [4], - "output": true - }, - { - "input": [5], - "output": false - }, - { - "input": [16], - "output": true - }, - { - "input": [18], - "output": false - }, - { - "input": [1024], - "output": true - } -] \ No newline at end of file diff --git a/logic/power-of-two/meta.json b/logic/power-of-two/meta.json deleted file mode 100644 index 7606cefc..00000000 --- a/logic/power-of-two/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Power of Two", - "name": "power_of_two", - "difficulty": "hard", - "author": "ChatGPT", - "category": "Logic", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/logic/power-of-two/starter.py b/logic/power-of-two/starter.py deleted file mode 100644 index 508deb34..00000000 --- a/logic/power-of-two/starter.py +++ /dev/null @@ -1 +0,0 @@ -def power_of_two(n: int) -> bool: \ No newline at end of file diff --git a/logic/pyramid-problem/description.md b/logic/pyramid-problem/description.md index 6c06c0e5..5a2e9faa 100644 --- a/logic/pyramid-problem/description.md +++ b/logic/pyramid-problem/description.md @@ -1,14 +1,10 @@ +Write a function `pyramid_volume(length: int, width: int, height: int) -> str` that determines the volume of a pyramid with a rectangular base using the following formula: `(length x width x height) / 3` -Write a function `pyramid_volume(L, W, H)` that determines the volume of a pyramid with a rectangular base: - -- If the volume of the pyramid is greater than 40, return: "That's a big pyramid!" -- If the volume of the pyramid is between 25-39, return: "I mean, it's alright..." -- If the volume of the pyramid is below 25, return: "Baby pyramid" +- If the volume of the pyramid is 40 or greater, return: `"That's a big pyramid!"`. +- If the volume of the pyramid is between 25-39 (inclusive), return: `"I mean, it's alright..."`. +- If the volume of the pyramid is less than 25, return: `"Baby pyramid"`. For example: -- `pyramid_volume(5, 6, 7)` → `"That's a big pyramid!"` -- `pyramid_volume(3, 6, 6)` → `"I mean, it's alright..."` -- `pyramid_volume(2, 3, 4)` → `"Baby pyramid"` - - -*Note:* Rectangular base pyramid volume formula = (length x width x height)/3 +- `pyramid_volume(5, 6, 7) → 70 → "That's a big pyramid!"` +- `pyramid_volume(3, 6, 6) → 36 → "I mean, it's alright..."` +- `pyramid_volume(2, 3, 4) → 24 → "Baby pyramid"` diff --git a/logic/pyramid-problem/io.json b/logic/pyramid-problem/io.json index 4f2a9cbd..07874e4a 100644 --- a/logic/pyramid-problem/io.json +++ b/logic/pyramid-problem/io.json @@ -4,11 +4,11 @@ "output": "That's a big pyramid!" }, { - "input": [0, 3, 12], + "input": [0, 3, 120], "output": "Baby pyramid" }, { - "input": [-7, 4, 1], + "input": [7, 4, 1], "output": "Baby pyramid" }, { @@ -16,7 +16,27 @@ "output": "Baby pyramid" }, { - "input": [250, 1, 0.3], + "input": [80, 1, 1], "output": "I mean, it's alright..." + }, + { + "input": [3, 1, 1], + "output": "Baby pyramid" + }, + { + "input": [5, 5, 5], + "output": "That's a big pyramid!" + }, + { + "input": [1, 2, 3], + "output": "Baby pyramid" + }, + { + "input": [100, 100, 100], + "output": "That's a big pyramid!" + }, + { + "input": [4, 20, 26], + "output": "That's a big pyramid!" } ] diff --git a/logic/pyramid-problem/starter.py b/logic/pyramid-problem/starter.py index 7439d353..1364be98 100644 --- a/logic/pyramid-problem/starter.py +++ b/logic/pyramid-problem/starter.py @@ -1 +1,3 @@ -def pyramid_volume(l, w, h): +def pyramid_volume(length: int, width: int, height: int) -> str: + # Your code here + pass \ No newline at end of file diff --git a/logic/two-or-three/description.md b/logic/two-or-three/description.md index ff694a52..3ca46846 100644 --- a/logic/two-or-three/description.md +++ b/logic/two-or-three/description.md @@ -1,3 +1,6 @@ -Write a function `two_or_three(n: int) -> bool` that takes an integer n and returns True if the number is a multiple of 2 or a multiple of 3, but not both. +Write a function `two_or_three(n: int) -> bool` that takes an integer `n` and returns `True` if `n` is a multiple of 2 or a multiple of 3, **but not both**. -For example, 6 is a multiple of both 2 and 3, so the function should return False. But 4 is a multiple of 2 only, and 9 is a multiple of 3 only, so both should return True. \ No newline at end of file +For example: +- `two_or_three(6) → False` as 6 is a multiple of both 2 and 3. +- `two_or_three(4) → True` as 4 is a multiple of 2 and not 3. +- `two_or_three(9) → False` as 9 is a multiple of 3 and not 2. diff --git a/logic/two-or-three/io.json b/logic/two-or-three/io.json index 534d1262..7955971f 100644 --- a/logic/two-or-three/io.json +++ b/logic/two-or-three/io.json @@ -26,5 +26,17 @@ { "input": [-3], "output": true + }, + { + "input": [55], + "output": false + }, + { + "input": [2000], + "output": true + }, + { + "input": [66], + "output": false } ] diff --git a/logic/two-or-three/starter.py b/logic/two-or-three/starter.py index 9c74ee90..35be1a9a 100644 --- a/logic/two-or-three/starter.py +++ b/logic/two-or-three/starter.py @@ -1 +1,3 @@ -def two_or_three(n: int) -> bool: \ No newline at end of file +def two_or_three(n: int) -> bool: + # Your code here + pass \ No newline at end of file From 73eba44a4dcd07acdbed7f548363c9d19fb8812d Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Thu, 16 Apr 2026 10:37:52 -0400 Subject: [PATCH 5/8] Tweak pyramid-area test cases to hit every size threshold edge --- logic/pyramid-problem/description.md | 2 +- logic/pyramid-problem/io.json | 36 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/logic/pyramid-problem/description.md b/logic/pyramid-problem/description.md index 5a2e9faa..dfa81446 100644 --- a/logic/pyramid-problem/description.md +++ b/logic/pyramid-problem/description.md @@ -7,4 +7,4 @@ Write a function `pyramid_volume(length: int, width: int, height: int) -> str` t For example: - `pyramid_volume(5, 6, 7) → 70 → "That's a big pyramid!"` - `pyramid_volume(3, 6, 6) → 36 → "I mean, it's alright..."` -- `pyramid_volume(2, 3, 4) → 24 → "Baby pyramid"` +- `pyramid_volume(2, 3, 5) → 10 → "Baby pyramid"` diff --git a/logic/pyramid-problem/io.json b/logic/pyramid-problem/io.json index 07874e4a..a548f348 100644 --- a/logic/pyramid-problem/io.json +++ b/logic/pyramid-problem/io.json @@ -1,42 +1,42 @@ [ { - "input": [3, 9, 5], + "input": [5, 6, 7], "output": "That's a big pyramid!" }, { - "input": [0, 3, 120], - "output": "Baby pyramid" - }, - { - "input": [7, 4, 1], - "output": "Baby pyramid" + "input": [3, 6, 6], + "output": "I mean, it's alright..." }, { "input": [2, 3, 5], "output": "Baby pyramid" }, { - "input": [80, 1, 1], - "output": "I mean, it's alright..." + "input": [5, 5, 5], + "output": "That's a big pyramid!" }, { - "input": [3, 1, 1], - "output": "Baby pyramid" + "input": [40, 20, 26], + "output": "That's a big pyramid!" }, { - "input": [5, 5, 5], + "input": [2, 6, 10], "output": "That's a big pyramid!" }, { - "input": [1, 2, 3], - "output": "Baby pyramid" + "input": [3, 13, 3], + "output": "I mean, it's alright..." }, { - "input": [100, 100, 100], - "output": "That's a big pyramid!" + "input": [5, 5, 3], + "output": "I mean, it's alright..." }, { - "input": [4, 20, 26], - "output": "That's a big pyramid!" + "input": [9, 4, 2], + "output": "Baby pyramid" + }, + { + "input": [0, 1, 2], + "output": "Baby pyramid" } ] From 6a3ef373a2046b59ce5f2a497cd28885a50582a6 Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Thu, 16 Apr 2026 10:40:13 -0400 Subject: [PATCH 6/8] Rename pyramid-problem to pyramid-area to be consistent with naming conventions --- logic/{pyramid-problem => pyramid-volume}/description.md | 0 logic/{pyramid-problem => pyramid-volume}/io.json | 0 logic/{pyramid-problem => pyramid-volume}/meta.json | 0 logic/{pyramid-problem => pyramid-volume}/starter.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename logic/{pyramid-problem => pyramid-volume}/description.md (100%) rename logic/{pyramid-problem => pyramid-volume}/io.json (100%) rename logic/{pyramid-problem => pyramid-volume}/meta.json (100%) rename logic/{pyramid-problem => pyramid-volume}/starter.py (100%) diff --git a/logic/pyramid-problem/description.md b/logic/pyramid-volume/description.md similarity index 100% rename from logic/pyramid-problem/description.md rename to logic/pyramid-volume/description.md diff --git a/logic/pyramid-problem/io.json b/logic/pyramid-volume/io.json similarity index 100% rename from logic/pyramid-problem/io.json rename to logic/pyramid-volume/io.json diff --git a/logic/pyramid-problem/meta.json b/logic/pyramid-volume/meta.json similarity index 100% rename from logic/pyramid-problem/meta.json rename to logic/pyramid-volume/meta.json diff --git a/logic/pyramid-problem/starter.py b/logic/pyramid-volume/starter.py similarity index 100% rename from logic/pyramid-problem/starter.py rename to logic/pyramid-volume/starter.py From eb7a4ab3a4c4f4809c2b3e0157ffb939d9991ef5 Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Thu, 16 Apr 2026 10:50:34 -0400 Subject: [PATCH 7/8] Fix incorrect example, add another, and tweak test cases in two-or-three --- logic/two-or-three/description.md | 7 ++++--- logic/two-or-three/io.json | 18 +++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/logic/two-or-three/description.md b/logic/two-or-three/description.md index 3ca46846..62bf7b2a 100644 --- a/logic/two-or-three/description.md +++ b/logic/two-or-three/description.md @@ -1,6 +1,7 @@ -Write a function `two_or_three(n: int) -> bool` that takes an integer `n` and returns `True` if `n` is a multiple of 2 or a multiple of 3, **but not both**. +Write a function `two_or_three(n: int) -> bool` that takes an integer `n` and returns `True` if `n` is a multiple of *either* 2 or 3, and `False` if `n` is a multiple of both or neither. For example: -- `two_or_three(6) → False` as 6 is a multiple of both 2 and 3. - `two_or_three(4) → True` as 4 is a multiple of 2 and not 3. -- `two_or_three(9) → False` as 9 is a multiple of 3 and not 2. +- `two_or_three(9) → True` as 9 is a multiple of 3 and not 2. +- `two_or_three(6) → False` as 6 is a multiple of both 2 and 3. +- `two_or_three(7) → False` as 7 is a multiple of neither 2 nor 3. diff --git a/logic/two-or-three/io.json b/logic/two-or-three/io.json index 7955971f..2ae9e7f3 100644 --- a/logic/two-or-three/io.json +++ b/logic/two-or-three/io.json @@ -4,21 +4,21 @@ "output": false }, { - "input": [12], - "output": false - }, - { - "input": [2], + "input": [4], "output": true }, { - "input": [3], + "input": [9], "output": true }, { - "input": [0], + "input": [7], "output": false }, + { + "input": [3], + "output": true + }, { "input": [-6], "output": false @@ -32,11 +32,11 @@ "output": false }, { - "input": [2000], + "input": [0], "output": true }, { - "input": [66], + "input": [11], "output": false } ] From 38ff3b62729e1276e35ec1d93caa83ece76c3b3b Mon Sep 17 00:00:00 2001 From: Luke Weaver Date: Thu, 16 Apr 2026 10:54:10 -0400 Subject: [PATCH 8/8] One more two-or-three test case change --- logic/two-or-three/io.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logic/two-or-three/io.json b/logic/two-or-three/io.json index 2ae9e7f3..909c1371 100644 --- a/logic/two-or-three/io.json +++ b/logic/two-or-three/io.json @@ -33,7 +33,7 @@ }, { "input": [0], - "output": true + "output": false }, { "input": [11],