Skip to content

Commit 8cb9a85

Browse files
Fix miscellaneous typos and spelling mistakes
1 parent f221fd6 commit 8cb9a85

24 files changed

+38
-38
lines changed

data/part-10/1-class-hierarchies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class PlatinumCard(BonusCard):
307307
return bonus
308308
```
309309

310-
So, the bonus for a PlatinumCard is calculated by calling the overriden method in the base class, and then adding an extra 5 percent to the base result. An example of how these classes are used:
310+
So, the bonus for a PlatinumCard is calculated by calling the overridden method in the base class, and then adding an extra 5 percent to the base result. An example of how these classes are used:
311311

312312
```python
313313
if __name__ == "__main__":

data/part-10/4-application-development.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Objects and classes are by no means necessary in every programming context. For
2626

2727
When programs grow in complexity, the amount of details quickly becomes unmanageable, unless the program is organised in some systematic way. Even some of the more complicated exercises on this course so far would have benefited from the examples set in this part of the material.
2828

29-
Fo decades the concept of [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns) has been one of the central principles in programming, and the larger field of computer science. Quoting from Wikipedia:
29+
For decades the concept of [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns) has been one of the central principles in programming, and the larger field of computer science. Quoting from Wikipedia:
3030

3131
_Separation of concerns is a design principle for separating a computer program into distinct sections such that each section addresses a separate concern. A concern is a set of information that affects the code of a computer program._
3232

@@ -147,7 +147,7 @@ application = PhoneBookApplication()
147147
application.execute()
148148
```
149149

150-
This program doesn't do very much yet, but let's go through the contents. The constructor method creates a new PhoneBook, which is stored in a private attribute. The method `execute(self)` starts the program's text-based user interface, the core of which is the `while` loop, which keeps asking the user for commands until they type in the command for exiting. There is also a method for intructions, `help(self)`, which is called before entering the loop, so that the instructions are printed out.
150+
This program doesn't do very much yet, but let's go through the contents. The constructor method creates a new PhoneBook, which is stored in a private attribute. The method `execute(self)` starts the program's text-based user interface, the core of which is the `while` loop, which keeps asking the user for commands until they type in the command for exiting. There is also a method for instructions, `help(self)`, which is called before entering the loop, so that the instructions are printed out.
151151

152152
Now, let's add some actual functionality. First, we implement adding new data to the phone book:
153153

@@ -680,7 +680,7 @@ The file handling process in the PhoneBook application proceeds as follows: the
680680
There are many good guidebooks for learning about good programming practices. One such is [Clean Code](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882) by Robert Martin. The code examples in the book are implemented in Java, however, so working through the examples can be quite cumbersome at this point in your programming career, although the book itself is much recommended by the course staff. The themes of easily maintained, expandable, good quality code will be further explored on the courses
681681
[Software Development Methods](https://studies.helsinki.fi/courses/cu/hy-CU-118024742-2020-08-01) and [Software Engineering](https://studies.helsinki.fi/courses/cu/hy-CU-118024909-2020-08-01).
682682

683-
Writing code according to established object oriented programming principles comes at a price. You will likely end up writing more code than you would, were you to write your implementation in one continuous bout of spaghetti code. One of the key skills of a porgrammer is to decide the best approach for each situation. Sometimes it is necessary to just hack something together quickly for immediate use. On the other hand, if in the foreseeable future it can be expected that the code will be reused, maintained or futher developed, either by you or, more critically, by someone else entirely, the readability and logical modularity of the program code become essential. More often than not, if it is worth doing, it is worth doing well, even in the very early stages of development.
683+
Writing code according to established object oriented programming principles comes at a price. You will likely end up writing more code than you would, were you to write your implementation in one continuous bout of spaghetti code. One of the key skills of a programmer is to decide the best approach for each situation. Sometimes it is necessary to just hack something together quickly for immediate use. On the other hand, if in the foreseeable future it can be expected that the code will be reused, maintained or further developed, either by you or, more critically, by someone else entirely, the readability and logical modularity of the program code become essential. More often than not, if it is worth doing, it is worth doing well, even in the very early stages of development.
684684

685685
To finish off this part of the material you will implement one more larger application.
686686

data/part-11/1-list-comprehensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ numbers = [1, 2, 3, 6, 5, 4, 7]
3838
strings = [str(number) for number in numbers]
3939
```
4040

41-
The second line above contains many of the same elements as the more traditional iterative apporach, but the syntax is different. One way of generalising a list comprehension statement would be
41+
The second line above contains many of the same elements as the more traditional iterative approach, but the syntax is different. One way of generalising a list comprehension statement would be
4242

4343
`[<expression> for <item> in <series>]`
4444

@@ -107,7 +107,7 @@ if __name__ == "__main__":
107107
print(factorials)
108108
```
109109

110-
List comprehensions allow us to express the same functionality more consisely, usually without losing any of the readability.
110+
List comprehensions allow us to express the same functionality more concisely, usually without losing any of the readability.
111111

112112
We can also return a list comprehension statement from a function directly. If we needed a function for producing factorials for lists of numbers, we could achieve it very concisely:
113113

data/part-11/2-more-comprehensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ When the function is called with the arguments `most_common_words("comprehension
443443

444444
</sample-output>
445445

446-
NB: the case of letters affects the results, and all inflected forms are unique words in this exercise. That is, the words `List`, `lists` and `list` are each separate words here, and only `list` has enough occurrences to make it to the returned list. All punctutation should be removed before counting up the occurrences.
446+
NB: the case of letters affects the results, and all inflected forms are unique words in this exercise. That is, the words `List`, `lists` and `list` are each separate words here, and only `list` has enough occurrences to make it to the returned list. All punctuation should be removed before counting up the occurrences.
447447

448448
It is up to you to decide how to implement this. The easiest way would likely be to make use of list and dictionary comprehensions.
449449

data/part-11/3-recursion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The factorial of 6 is 720
146146

147147
If the parameter of the recursive factorial function is 0 or 1, the function returns 1, because this is how the factorial operation is defined. In any other case the function returns the value `n * factorial(n - 1)`, which is the value of its parameter `n` multiplied by the return value of the function call `factorial(n - 1)`.
148148

149-
The crucial part here is that the function definition contains a stop condition. If this is met, the recursion ends. In this case that condition is `n < 2`. We know it will be reached eventually, beacuse the value passed as the argument to the function is decreased by one on each level of the recursion.
149+
The crucial part here is that the function definition contains a stop condition. If this is met, the recursion ends. In this case that condition is `n < 2`. We know it will be reached eventually, because the value passed as the argument to the function is decreased by one on each level of the recursion.
150150

151151
The [visualisation tool](http://www.pythontutor.com/visualize.html#mode=edit) can be a great help in making sense of recursive programs.
152152

data/part-11/4-more-recursion-examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ The first exercise point is granted for a working application when all user inpu
459459

460460
## Handling errors in user input
461461

462-
To gain the second exercise point for this exercise your application is expected to recover from erroneus user input. Any input which does not follow the specified format should produce an error message _erroneous input_, and result in yet another repeat of the loop asking for a new command:
462+
To gain the second exercise point for this exercise your application is expected to recover from erroneous user input. Any input which does not follow the specified format should produce an error message _erroneous input_, and result in yet another repeat of the loop asking for a new command:
463463

464464
<sample-output>
465465

data/part-12/2-generators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ jkl
249249

250250
Please write a function named `word_generator(characters: str, length: int, amount: int)` which returns a new generator for generating random words based on the parameters given.
251251

252-
A random word is generated by selecting from the string named `characters` as many characters as is indicated by the argument `length`. The same character can appear many times in a random word.
252+
A random word is generated by selecting from the string named `characters` as many characters as indicated by the argument `length`. The same character can appear many times in a random word.
253253

254254
The generator returns as many words as specified by the argument `amount` before terminating.
255255

data/part-12/3-functional-programming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ If the initial value is left out, `reduce` takes the first item in the list as t
650650

651651
</text-box>
652652

653-
**NB:** if the items in the series are of a different type than the intended reduced result, the thrd argument is mandatory. The example with the bank accounts would not work without the initial value. That is, trying this
653+
**NB:** if the items in the series are of a different type than the intended reduced result, the third argument is mandatory. The example with the bank accounts would not work without the initial value. That is, trying this
654654

655655
```python
656656
balances_total = reduce(balance_sum_helper, accounts)

data/part-4/4-definite-iteration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ for i in range(1, 9, 2):
176176

177177
</sample-output>
178178

179-
A step can also be negative. Then the range will be in reversed orded. Notice the first two arguments are also flipped here:
179+
A step can also be negative. Then the range will be in reversed order. Notice the first two arguments are also flipped here:
180180

181181
```python
182182
for i in range(6, 2, -1):

data/part-5/1-more-lists.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Alan: age 39 years, height 1.78 meters
300300

301301
The `for` loop goes through the items in the outer list one by one. That is, each list containing information about a single person is, in turn, assigned to the variable `person`.
302302

303-
Lists arent always the best way to present data, such as information about a person. We will soon come across Python _dictionaries_, which are often better suited to such situations.
303+
Lists aren't always the best way to present data, such as information about a person. We will soon come across Python _dictionaries_, which are often better suited to such situations.
304304

305305
## Matrices
306306

@@ -333,7 +333,7 @@ print(my_matrix)
333333

334334
</sample-output>
335335

336-
Like any other list, the rows of the matrix can be traversed wth a `for` loop. The following code prints out each row of the matrix on a separate line:
336+
Like any other list, the rows of the matrix can be traversed with a `for` loop. The following code prints out each row of the matrix on a separate line:
337337

338338
```python
339339
my_matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

0 commit comments

Comments
 (0)