From 6e47f03a7b6bac24922dc835687866da4fd64ee1 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 15 May 2026 00:24:43 -0700 Subject: [PATCH 1/2] Typos and formatting error corrections for numbers, bools, and currency exchange exercise. --- concepts/bools/about.md | 28 +++++++++---------- concepts/numbers/about.md | 2 +- .../currency-exchange/.meta/exemplar.py | 2 +- .../concept/currency-exchange/exchange.py | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/concepts/bools/about.md b/concepts/bools/about.md index 0b8354750a3..0a31448c55d 100644 --- a/concepts/bools/about.md +++ b/concepts/bools/about.md @@ -22,10 +22,10 @@ Each of the operators has a different precedence, where `not` is evaluated befor Brackets can be used to evaluate one part of the expression before the others: ```python ->>>not True and True +>>> not True and True False ->>>not (True and False) +>>> not (True and False) True ``` @@ -45,25 +45,25 @@ A few `built-ins` are always considered `False` by definition: ```python ->>>bool(None) +>>> bool(None) False ->>>bool(1) +>> >bool(1) True ->>>bool(0) +>>> bool(0) False ->>>bool([1,2,3]) +>>> bool([1,2,3]) True ->>>bool([]) +>>> bool([]) False ->>>bool({"Pig" : 1, "Cow": 3}) +>>> bool({"Pig" : 1, "Cow": 3}) True ->>>bool({}) +>>> bool({}) False ``` @@ -95,10 +95,10 @@ The `bool` type is implemented as a _sub-type_ of _int_. ```python ->>>1 == True +>>> 1 == True True ->>>0 == False +>>> 0 == False True ``` @@ -106,14 +106,14 @@ However, `bools` are **still different** from `ints`, as noted when comparing th ```python ->>>1 is True +>>> 1 is True False ->>>0 is False +>>> 0 is False False ``` -> Note: in python >= 3.8, using a literal (such as 1, '', [], or {}) on the _left side_ of `is` will raise a warning. +> Note: in python >= 3.8, using a literal (such as `1`, `''`, `[]`, or `{}`) on the _left side_ of `is` will raise a warning. It is considered a [Python anti-pattern][comparing to true in the wrong way] to use the equality operator to compare a boolean variable to `True` or `False`. diff --git a/concepts/numbers/about.md b/concepts/numbers/about.md index 1155bcf7a5c..3fa63c140d9 100644 --- a/concepts/numbers/about.md +++ b/concepts/numbers/about.md @@ -135,7 +135,7 @@ Numbers can be converted from `int` to `floats` and `floats` to `int` using the ## Round -Python provides a built-in function [`round(number, )`][round] to round off a floating point number to a given number of decimal places. +Python provides a built-in function [`round(, )`][round] to round off a floating point number to a given number of decimal places. If no number of decimal places is specified, the number is rounded off to the nearest integer and will return an `int`: ```python diff --git a/exercises/concept/currency-exchange/.meta/exemplar.py b/exercises/concept/currency-exchange/.meta/exemplar.py index c7e497bbe15..d835bce65c3 100644 --- a/exercises/concept/currency-exchange/.meta/exemplar.py +++ b/exercises/concept/currency-exchange/.meta/exemplar.py @@ -40,7 +40,7 @@ def get_change(budget, exchanging_value): float: The amount left of your starting currency after the exchange Examples: - .>>> get_change(127.5, 120.0) + >>> get_change(127.5, 120.0) 7.5 >>> get_change(300.75, 150.25) diff --git a/exercises/concept/currency-exchange/exchange.py b/exercises/concept/currency-exchange/exchange.py index 8d4cce6cf1d..c135c33beb9 100644 --- a/exercises/concept/currency-exchange/exchange.py +++ b/exercises/concept/currency-exchange/exchange.py @@ -42,7 +42,7 @@ def get_change(budget, exchanging_value): float: The amount left of your starting currency after the exchange Examples: - .>>> get_change(127.5, 120.0) + >>> get_change(127.5, 120.0) 7.5 >>> get_change(300.75, 150.25) From d2a44473d991058d25f4ea0c0c9d0ea74e7ff786 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 15 May 2026 11:43:08 -0700 Subject: [PATCH 2/2] Fixed spacing on line 51. --- concepts/bools/about.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/bools/about.md b/concepts/bools/about.md index 0a31448c55d..7015fdfafa4 100644 --- a/concepts/bools/about.md +++ b/concepts/bools/about.md @@ -48,7 +48,7 @@ A few `built-ins` are always considered `False` by definition: >>> bool(None) False ->> >bool(1) +>>> bool(1) True >>> bool(0)