Skip to content

Commit 102bfb7

Browse files
authored
Hopefully, the last typos of this round. (#3817)
1 parent 27931ea commit 102bfb7

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

concepts/bitwise-operators/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This means that all bits are inverted and a number is _**interpreted as negative
117117
Positive numbers have an MSB of `0`.
118118
This representation has the advantage of only having one version of zero, so that the programmer doesn't have to manage `-0` and `+0`.
119119

120-
This way of representing negative and positive numbers adds a complication for Python: there are no finite-integer concepts like `int32` or `int64` internally in the core langauge.
120+
This way of representing negative and positive numbers adds a complication for Python: there are no finite-integer concepts like `int32` or `int64` internally in the core language.
121121
In 'modern' Python, `int`s are of unlimited size (_limited only by hardware capacity_), and a negative or bit-inverted number has a (_theoretically_) infinite number of `1`'s to the left, just as a positive number has unlimited `0`'s.
122122

123123
This makes it difficult to give a useful example of `bitwise not`:

exercises/practice/bob/.approaches/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Regardless of the approach used, some things you could look out for include
1313

1414
- Use the [`endswith`][endswith] method instead of checking the last character by index for `?`.
1515

16-
- Don't copy/paste the logic for determining a shout and for determing a question into determing a shouted question.
16+
- Don't copy/paste the logic for determining a shout and for determining a question into determining a shouted question.
1717
Combine the two determinations instead of copying them.
1818
Not duplicating the code will keep the code [DRY][dry].
1919

exercises/practice/nth-prime/.approaches/generator-fun/content.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ Using a lambda expression, we `filter` out any numbers above two that are prime.
1919
Doesn't this result in an infinite loop?
2020
No - `filter` _also_ returns a generator object (which are [evaluated lazily][generator]), so while it's too will produce values infinitely if evaluated, it doesn't hang to program at the time of instantiation.
2121

22-
`itertools.islice` takes in a generator object and an end count, returning a generator object which _only evalutes until that end count_.
22+
`itertools.islice` takes in a generator object and an end count, returning a generator object which _only evaluates until that end count_.
2323

2424
The next line exhausts all the values in the generator except the end, and we finally return the last element.
2525

26-
We can utilize the `functools.cache` decorator for greater speeds at higher values of `number`, so we take it out. The added bonus is that a very long line of code is cleant up.
26+
We can utilize the `functools.cache` decorator for greater speeds at higher values of `number`, so we take it out.
27+
The added bonus is that a very long line of code is cleaned up.
28+
2729

2830
```python
2931
from itertools import islice, count

exercises/practice/roman-numerals/.approaches/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ As the textbooks say, further analysis of this approach is left as an exercise f
186186
## Which approach to use?
187187

188188
In production, it would make sense to use the `roman` package.
189-
It is debugged and supports Roman-to-Arabic conversions in addtion to the Arabic-to-Roman approaches discussed here.
189+
It is debugged and supports Roman-to-Arabic conversions in addition to the Arabic-to-Roman approaches discussed here.
190190

191191
Most submissions, like the `roman` package implementation, use some variant of [`loop-over-romans`][loop-over-romans].
192192

193-
Using a [2-D lookup table][table-lookup] takes a bit more initialization, but then everthing can be done in a list comprehension instead of nested loops.
193+
Using a [2-D lookup table][table-lookup] takes a bit more initialization, but then everything can be done in a list comprehension instead of nested loops.
194194
Python is relatively unusual in supporting both tuples-of-tuples and relatively fast list comprehensions, so the approach seems a good fit for this language.
195195

196196
No performance article is currently included for this exercise.

0 commit comments

Comments
 (0)