Skip to content

Commit

Permalink
Small Fixes from CI Fails
Browse files Browse the repository at this point in the history
Fixed some small argument name errors that were causing the CI to fail.

Also sorted reflinks and touched up some language int he `hints.md` file and the instructions.
  • Loading branch information
BethanyG committed Oct 20, 2023
1 parent fc8dbdf commit 32a8e93
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions exercises/concept/currency-exchange/.docs/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
## 4. Calculate number of bills

- You need to divide `amount` into `denomination`.
- You need to use type casting to _int_ to get the exact number of bills.
- You need to use type casting to `int` to get the exact number of bills.
- To remove decimal places from a `float`, you can convert it to `int`.

**Note:** The `//` operator also does floor division. But, if the operand has `float`, the result is still `float`.
Expand All @@ -32,12 +32,12 @@
## 6. Calculate value after exchange

- You need to calculate `spread` percent of `exchange_rate` using multiplication operator and add it to `exchange_rate` to get the exchanged currency.
- The actual rate needs to be computed. Remember to add exchange rate and exchange fee.
- You can get exchanged money affected by commission by using divide operation and type casting _int_.
- The actual rate needs to be computed. Remember to add exchange _rate_ and exchange _fee_.
- You can get exchanged money affected by commission by using divide operation and type casting to `int`.


[division-operator]: https://docs.python.org/3/tutorial/introduction.html#numbers
[multiplication-operator]: https://docs.python.org/3/tutorial/introduction.html#numbers
[python-numbers-tutorial]: https://docs.python.org/3/tutorial/introduction.html#numbers
[python-numeric-types]: https://docs.python.org/3.9/library/stdtypes.html#numeric-types-int-float-complex
[division-operator]: https://docs.python.org/3/tutorial/introduction.html#numbers
[subtraction-operator]: https://docs.python.org/3/tutorial/introduction.html#numbers
[multiplication-operator]: https://docs.python.org/3/tutorial/introduction.html#numbers
1 change: 1 addition & 0 deletions exercises/concept/currency-exchange/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Create the `exchange_money()` function, taking 2 parameters:
This function should return the value of the exchanged currency.

**Note:** If your currency is USD and you want to exchange USD for EUR with an exchange rate of `1.20`, then `1.20 USD == 1 EUR`.

```python
>>> exchange_money(127.5, 1.2)
106.25
Expand Down
8 changes: 4 additions & 4 deletions exercises/concept/currency-exchange/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ To convert a float to an integer, you can use `int()`. Also, to convert an integ
3.0
```

[arbitrary-precision]: https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic#:~:text=In%20computer%20science%2C%20arbitrary%2Dprecision,memory%20of%20the%20host%20system.
[numeric-type-docs]: https://docs.python.org/3/library/stdtypes.html#typesnumeric
[`int()` built in]: https://docs.python.org/3/library/functions.html#int
[`float()` built in]: https://docs.python.org/3/library/functions.html#float
[0.30000000000000004.com]: https://0.30000000000000004.com/
[`float()` built in]: https://docs.python.org/3/library/functions.html#float
[`int()` built in]: https://docs.python.org/3/library/functions.html#int
[arbitrary-precision]: https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic#:~:text=In%20computer%20science%2C%20arbitrary%2Dprecision,memory%20of%20the%20host%20system.
[floating point math]: https://docs.python.org/3.9/tutorial/floatingpoint.html
[numeric-type-docs]: https://docs.python.org/3/library/stdtypes.html#typesnumeric
4 changes: 2 additions & 2 deletions exercises/concept/currency-exchange/.meta/exemplar.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_number_of_bills(amount, denomination):
:return: int - number of bills that can be obtained from the amount.
"""

return int(budget) // denomination
return int(amount) // denomination


def get_leftover_of_bills(amount, denomination):
Expand All @@ -50,7 +50,7 @@ def get_leftover_of_bills(amount, denomination):
:return: float - the amount that is "leftover", given the current denomination.
"""

return budget % denomination
return amount % denomination


def exchangeable_value(budget, exchange_rate, spread, denomination):
Expand Down

0 comments on commit 32a8e93

Please sign in to comment.