Skip to content

Commit 48fca0a

Browse files
committed
Many minor fixes
Fixed some em-dashes that were actually hyphens, a few terms that were missing backticks, some indentation errors, one codeblock that didn't have closing triple-backticks, a few invalid links, some minor spacing errors, a few typos, one missing level-one header, one level-three header that should be a level-two header, one incorrectly wrapped paragraph, a few "-->"s that would be more clear as "to"s, a few headers that weren't surrounded by blank lines, one incorrectly placed ref-link, and one level-two heading that should be a level-one header.
1 parent fcd3f71 commit 48fca0a

66 files changed

Lines changed: 310 additions & 298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

concepts/binary-octal-hexadecimal/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ As with binary and octal, giving the wrong base will raise a `ValueError`.
219219

220220

221221
[binary]: https://en.wikipedia.org/wiki/Binary_number
222-
[bit_count]: https://docs.python.org/3/library/stdtypes.html#int.bit_count
222+
[bit_count]: https://docs.python.org/3/library/stdtypes.html#int.bit_count
223223
[bit_length]: https://docs.python.org/3/library/stdtypes.html#int.bit_length
224224
[hexadecimal]: https://en.wikipedia.org/wiki/Hexadecimal
225225
[numeral-systems]: https://en.wikipedia.org/wiki/Numeral_system

concepts/classes/about.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`Classes` combine data with behavior.
44
Classes are used to create copies or `instances` of bundled data and behavior, commonly known as `objects`.
5-
Objects can represent real world entities (_such as cars or cats_) - or more abstract concepts (_such as integers, vehicles, or mammals_).
5+
Objects can represent real world entities (_such as cars or cats_) or more abstract concepts (_such as integers, vehicles, or mammals_).
66
Classes are integral to an [object oriented programming][oop] (OOP) approach, which asks the programmer to think about modeling a problem as one or more objects that interact with one another, keep state, and act upon data.
77

88
## Classes
@@ -41,7 +41,7 @@ An instance (_object_) of `MyClass` can be created and bound to a name:
4141
<__main__.MyClass at 0x15adc55b0>
4242
```
4343

44-
`Class attributes` are shared across all objects (_or instances_) created from a class, and can be accessed via [`dot notation`][dot notation] - a `.` placed after the object name and before the attribute name:
44+
`Class attributes` are shared across all objects (_or instances_) created from a class, and can be accessed via [`dot notation`][dot notation] a `.` placed after the object name and before the attribute name:
4545

4646
```python
4747
>>> new_object = MyClass()
@@ -66,7 +66,7 @@ True
6666
```
6767

6868
Class attributes are defined in the body of the class itself, before any other methods.
69-
They are owned by the class - allowing them to be shared across instances.
69+
They are owned by the class allowing them to be shared across instances.
7070
Because these attributes are shared by all instances of the class, their value can be accessed and manipulated from the class directly.
7171
Altering the value of class attributes alters the value _**for all objects instantiated from the class**_:
7272

@@ -289,7 +289,7 @@ class MyClass:
289289

290290
In previous concept exercises and practice exercise stubs, you will have seen the `pass` keyword used within the body of functions in place of actual code.
291291

292-
The `pass` keyword is a syntactically valid placeholder - it prevents Python from throwing a syntax error for an empty function or class definition.
292+
The `pass` keyword is a syntactically valid placeholder it prevents Python from throwing a syntax error for an empty function or class definition.
293293
Essentially, it is a way to say to the Python interpreter, 'Don't worry! I _will_ put code here eventually, I just haven't done it yet.'
294294

295295
```python

concepts/classes/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Classes are definitions combining data (_otherwise known as `attributes`, `properties`,`data members`, `variables`, or `fields`_) with `functions` (_otherwise known as `methods`_).
44
Class definitions are used to create copies or `instances` of the `class`, commonly known as `objects`.
5-
Objects can represent real world entities (_such as cars or cats_) - or more abstract concepts (_such as integers, vehicles, or mammals_).
5+
Objects can represent real world entities (_such as cars or cats_) or more abstract concepts (_such as integers, vehicles, or mammals_).
66
Each object is unique in computer memory and represents some part of an overall model.
77
Classes and objects can be found in several programming paradigms, but are integral to [object oriented programming][oop] (OOP), in which programs are made up of objects that interact with one another.
88

concepts/comparisons/about.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ False
8282

8383
Strings (`str`) are compared [_lexicographically_][lexographic order], using their individual Unicode code points (_the result of passing each code point in the `str` to the built-in function [`ord()`][ord], which returns an `int`_).
8484
If all code points in both strings match and are _**in the same order**_, the two strings are considered equal.
85-
This comparison is done in a 'pair-wise' fashion - first-to-first, second-to-second, etc.
85+
This comparison is done in a 'pair-wise' fashion first-to-first, second-to-second, etc.
8686
In Python 3.x, `str` and `bytes` cannot be directly coerced/compared.
8787

8888
```python
@@ -116,7 +116,7 @@ False
116116

117117
## Comparing Container Data Types
118118

119-
Container data types (_`lists`, `tuples`, `sets`, `dicts`, etc._) also compare [_lexicographically_][lexographic order] - they are equal if both containers have the same data **and** the same data types (_in the case of `lists` and `tuples`, they must also have the same **ordering**_), unequal otherwise.
119+
Container data types (_`lists`, `tuples`, `sets`, `dicts`, etc._) also compare [_lexicographically_][lexographic order] they are equal if both containers have the same data **and** the same data types (_in the case of `lists` and `tuples`, they must also have the same **ordering**_), unequal otherwise.
120120

121121
```python
122122
>>> [1, 2] == [1, 2]
@@ -148,7 +148,7 @@ Comparison operators can be chained _arbitrarily_.
148148
Note that the evaluation of an expression takes place from `left` to `right`.
149149
For example, `x < y <= z` is equivalent to `x < y and y <= z`, except that `y` is evaluated **only once**.
150150
In both cases, `z` is _not_ evaluated **at all** when `x < y` is found to be `False`.
151-
This is often called `short-circuit evaluation` - the evaluation stops if the truth value of the expression has already been determined.
151+
This is often called `short-circuit evaluation` the evaluation stops if the truth value of the expression has already been determined.
152152

153153
`Short circuiting` is supported by various boolean operators, functions, and also by comparison chaining in Python.
154154
Unlike many other programming languages, including `C`, `C++`, `C#`, and `Java`, chained expressions like `a < b < c` in Python have a conventional [mathematical interpretation][three way boolean comparison] and precedence.

concepts/complex-numbers/about.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ ValueError: complex() arg is a malformed string
4444
>>> z2
4545
(2+1.5j)
4646
```
47+
4748
The end result is identical to using the `complex()` constructor.
4849

4950

@@ -98,6 +99,7 @@ However, it is still a complex number in Python:
9899
You may have heard that "`i` (or `j`) is the square root of -1".
99100

100101
For now, all this means is that the imaginary part _by definition_ satisfies the equality
102+
101103
```python
102104
1j * 1j == -1 # => True
103105
```
@@ -148,7 +150,7 @@ Integer division is ___not___ possible on complex numbers, so the `//` and `%` o
148150

149151
There are two functions implemented for numeric types that are very useful when working with complex numbers:
150152

151-
- `<complex number>.conjugate()` simply flips the sign of the imaginary part of a complex number (_from + to - or vice-versa_).
153+
- `<complex number>.conjugate()` simply flips the sign of the imaginary part of a complex number (_from `+` to `-` or vice-versa_).
152154
- Because of the way complex multiplication works, this is more useful than you might think.
153155
- `abs(<complex number>)` is guaranteed to return a real number with no imaginary part.
154156

@@ -212,7 +214,7 @@ It was strange and new in the 16th century.
212214
### Why would anyone use these?
213215

214216
It turns out that complex numbers are the simplest way to describe anything that rotates or anything with a wave-like property.
215-
So they are used widely in electrical engineering, audio processing, physics, computer gaming, and navigation - to name only a few applications.
217+
So they are used widely in electrical engineering, audio processing, physics, computer gaming, and navigation to name only a few applications.
216218

217219
You can see things rotate.
218220
Complex numbers may not make the world go round, but they are great for explaining _what happens_ as a result of the world going round: look at any satellite image of a major storm.
@@ -257,4 +259,3 @@ So, you are probably using technology that relies on complex number calculations
257259
[engineering-complex]: https://www.khanacademy.org/science/electrical-engineering/ee-circuit-analysis-topic/ee-ac-analysis/v/ee-complex-numbers
258260
[ints]: https://docs.python.org/3/library/functions.html#int
259261
[floats]: https://docs.python.org/3/library/functions.html#float
260-

concepts/decorators/about.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ function3 = decorator_with_default_arg()(function3)
7171

7272
Most decorators are intended to _extend_ or _replace_ the behavior of another function, but some decorators may do nothing but return the functions they are wrapping.
7373

74-
Decorators are functions which take at least one argument - the function which they are wrapping.
74+
Decorators are functions which take at least one argument the function which they are wrapping.
7575
They usually return either the wrapped function or the result of an expression that uses the wrapped function.
7676

77-
A simple decorator - one that simply returns its wrapped function - can be written as follows:
77+
A simple decorator — one that simply returns its wrapped function — can be written as follows:
78+
7879
```python
7980
>>> def do_nothing(func):
8081
... return func

concepts/dict-methods/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The `dict` class in Python provides many useful [methods][dict-methods] for working with dictionaries.
44
Some were introduced in the concept for `dict`s.
5-
Here we cover a few more - along with some techniques for iterating through and manipulating dictionaries.
5+
Here we cover a few more along with some techniques for iterating through and manipulating dictionaries.
66

77
- `<dict>.setdefault()` automatically adds keys without throwing a KeyError.
88
- `<dict>.fromkeys(<iterable>, <default value>)` creates a new `dict` from any number of iterables.

concepts/functions/introduction.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Functions are used to perform specific and repetitive tasks.
55

66
More formally: a function is any Python object to which the [`function call`][calls] operation can be applied.
77
A function may be used to [`return`][return] one or more values as a result of some operation(s), or it may be used for one or more [`side effects`][side effects].
8-
If a function does not specify a return value it will still return `None`.
8+
If a function does not specify a return value it will still return `None`.
99

1010
Following is an example of a function with a side effect:
1111

1212
```python
1313
>>> def hello():
14-
... print("Hello")
14+
... print("Hello")
1515
...
1616
>>> hello()
1717
Hello
@@ -28,8 +28,8 @@ The argument is used by the `print` function to know what to print.
2828
Note that the body of the function is indented.
2929
The indentation is important because Python relies on it to know where that block of code ends.
3030
The function body ends at either the end of the program or just before the next line of code that is _not_ indented.
31-
Since `hello()` does not specify a `return` value, it executes its side effect - which is calling `print()` -- and then returns `None`.
32-
Finally, we call the function by using its name and the parentheses - which signals to the Python interpreter that this is a _callable_ name.
31+
Since `hello()` does not specify a `return` value, it executes its side effect which is calling `print()` and then returns `None`.
32+
Finally, we call the function by using its name and the parentheses which signals to the Python interpreter that this is a _callable_ name.
3333

3434
Following is an example of a function with a return value:
3535

@@ -61,7 +61,7 @@ Following is an example of a function which accepts an argument:
6161
>>> def hello(name):
6262
... return f"Hello, {name}"
6363
...
64-
>>>print(hello("Bob"))
64+
>>> print(hello("Bob"))
6565
Hello, Bob
6666

6767
```
@@ -81,6 +81,8 @@ Traceback (most recent call last):
8181
print(hello())
8282

8383
TypeError: hello() missing 1 required positional argument: 'name'
84+
```
85+
8486
If we don't want the program to error with no argument (_but want to allow the calling code to not supply one_), we can define a [default argument][default arguments].
8587
A default argument defines what value to use if the argument is missing when the function is called.
8688

@@ -92,7 +94,6 @@ Following is an example of a function with a default argument:
9294
...
9395
>>> print(hello())
9496
Hello, you
95-
9697
```
9798

9899
The `name` parameter is given the default argument of `"you"`, so the program outputs `Hello, you`, if not passed a `name` argument.
@@ -103,7 +104,8 @@ For more about function arguments, please see the [function arguments][function
103104
[arguments]: https://www.w3schools.com/python/gloss_python_function_arguments.asp
104105
[calls]: https://docs.python.org/3/reference/expressions.html#calls
105106
[def]: https://www.geeksforgeeks.org/python-def-keyword/
106-
[function arguments]: ../function-arguments/about.md
107+
[default arguments]: https://www.geeksforgeeks.org/default-arguments-in-python/
108+
[function arguments]: https://exercism.org/tracks/python/concepts/function-arguments
107109
[function]: https://docs.python.org/3/glossary.html#term-function
108110
[parameters]: https://www.codecademy.com/learn/flask-introduction-to-python/modules/learn-python3-functions/cheatsheet
109111
[return]: https://www.geeksforgeeks.org/python-return-statement/

concepts/generators/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A `generator` is a function or expression that returns a special type of [iterat
55

66
A generator function looks like any other function, but contains one or more [yield expressions][yield expression].
77
Each `yield` will suspend code execution, saving the current execution state (_including all local variables and try-statements_).
8-
When the generator resumes, it picks up state from the suspension - unlike regular functions which reset with every call.
8+
When the generator resumes, it picks up state from the suspension unlike regular functions which reset with every call.
99

1010

1111
## Constructing a generator
@@ -55,7 +55,7 @@ Generator-iterators and the iterators returned by common Python [`iterables`][it
5555
- They are not sequence types, and _do not_ have `indexes`.
5656
You cannot reference a previous or future value using addition or subtraction and you cannot use bracket (`[]`) notation or slicing.
5757
- They cannot be used with the `len()` function, as they have no length.
58-
- They can be _finite_ or _infinite_ - be careful when collecting all values from an _infinite_ `generator-iterator`!
58+
- They can be _finite_ or _infinite_ be careful when collecting all values from an _infinite_ `generator-iterator`!
5959
6060
[iterator]: https://docs.python.org/3.11/glossary.html#term-iterator
6161
[iterables]: https://wiki.python.org/moin/Iterator

concepts/generators/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A generator in Python is a _callable function_ or expression that returns a spec
55

66
A generator function looks like any other function, but contains one or more [yield expressions][yield expression].
77
Each `yield` will suspend code execution, saving the current execution state (_including all local variables and try-statements_).
8-
When the generator function resumes, it picks up state from the suspension - unlike regular functions which reset with every call.
8+
When the generator function resumes, it picks up state from the suspension unlike regular functions which reset with every call.
99

1010
[lazy iterator]: https://en.wikipedia.org/wiki/Lazy_evaluation
1111
[iterator]: https://docs.python.org/3.11/glossary.html#term-iterator

0 commit comments

Comments
 (0)