Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fundamentals/calculate-absolute/description.md
Original file line number Diff line number Diff line change
@@ -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!
**Hint**: You may want to Google how to find the absolute value of an integer in Python!
20 changes: 20 additions & 0 deletions fundamentals/calculate-absolute/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/calculate-absolute/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def calculate_absolute(n: int) -> int:
# Your code here
pass
7 changes: 3 additions & 4 deletions fundamentals/decimal-match/description.md
Original file line number Diff line number Diff line change
@@ -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.
18 changes: 17 additions & 1 deletion fundamentals/decimal-match/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/decimal-match/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def decimal_match(n: int, f: float) -> bool:
# Your code here
pass
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,17 @@
{
"input": [0, 1],
"output": false
},
{
"input": [555, 999],
"output": true
},
{
"input": [-2, -4],
"output": true
},
{
"input": [50, 1],
"output": false
}
]
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def difference_is_even(a: int, b: int) -> bool:
# Your code here
pass
3 changes: 0 additions & 3 deletions fundamentals/difference_21/description.md

This file was deleted.

34 changes: 0 additions & 34 deletions fundamentals/difference_21/io.json

This file was deleted.

10 changes: 0 additions & 10 deletions fundamentals/difference_21/meta.json

This file was deleted.

1 change: 0 additions & 1 deletion fundamentals/difference_21/starter.py

This file was deleted.

3 changes: 3 additions & 0 deletions fundamentals/exactly-one-true/description.md
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def exactly_one_true(a: bool, b: bool, c: bool) -> bool:
# Your code here
pass
3 changes: 0 additions & 3 deletions fundamentals/exactly_one_true/description.md

This file was deleted.

20 changes: 20 additions & 0 deletions fundamentals/extract-decimal/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/extract-decimal/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def extract_decimal(f: float) -> float:
# Your code here
pass
20 changes: 20 additions & 0 deletions fundamentals/grade-contribution/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": 24.0
},
{
"input": [40.0, 20.0],
"output": 8.0
},
{
"input": [80.0, 25.0],
"output": 20.0
}
]
2 changes: 2 additions & 0 deletions fundamentals/grade-contribution/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def grade_contribution(grade: float, weight: float) -> float:
# Your code here
pass
9 changes: 9 additions & 0 deletions fundamentals/grade-from-score/description.md
Original file line number Diff line number Diff line change
@@ -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!
3 changes: 3 additions & 0 deletions fundamentals/grade-from-score/starter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def grade_from_score(score: int) -> str:
# Your code here
pass
9 changes: 0 additions & 9 deletions fundamentals/grade_from_score/description.md

This file was deleted.

1 change: 0 additions & 1 deletion fundamentals/grade_from_score/starter.py

This file was deleted.

20 changes: 20 additions & 0 deletions fundamentals/integer-conversion-loss/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/integer-conversion-loss/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def integer_conversion_loss(n: float) -> bool:
# Your code here
pass
20 changes: 20 additions & 0 deletions fundamentals/is-even/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/is-even/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def is_even(n: int) -> bool:
# Your code here
pass
4 changes: 2 additions & 2 deletions fundamentals/is-multiple/description.md
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions fundamentals/is-multiple/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/is-multiple/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def is_multiple(a: int, b: int) -> bool:
# Your code here
pass
20 changes: 20 additions & 0 deletions fundamentals/makes-ten/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
2 changes: 2 additions & 0 deletions fundamentals/makes-ten/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def makes_ten(a: int, b: int) -> bool:
# Your code here
pass
Original file line number Diff line number Diff line change
@@ -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.
Loading
Loading