Skip to content

Commit 99290cd

Browse files
authored
fix minor typos (nnja#26)
* fix minor typos * remove duplicate words
1 parent 26625f2 commit 99290cd

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

website/content/02-introduction-to-python/110-control-statements-looping/05-looping-in-python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ If you can't remember how to use range, don't forget to call `help(range)` from
9898

9999
#### Looping over items with the index using `enumerate`.
100100

101-
In Python, we avoid writing code like like the JavaScript `for` loop at the top, but sometimes it's unavoidable, and we need a way to access the index of the items we're looping through. To do that we use a special function called `enumerate()`. The function takes a sequence, like a `list`, and it *returns* a `list` of tuples, containing the index of the item in the sequence, and the sequence itself.
101+
In Python, we avoid writing code like the JavaScript `for` loop at the top, but sometimes it's unavoidable, and we need a way to access the index of the items we're looping through. To do that we use a special function called `enumerate()`. The function takes a sequence, like a `list`, and it *returns* a `list` of tuples, containing the index of the item in the sequence, and the sequence itself.
102102

103103
Don't worry about the list of tuples for now, but remember our tuple unpacking from earlier?
104104

@@ -113,7 +113,7 @@ Don't worry about the list of tuples for now, but remember our tuple unpacking f
113113
11
114114
```
115115

116-
Because `enumerate()` returns a structure that looks like a list of `tuple`s under the hood, we can take advantage of tuple unpacking in the the `for` loop.
116+
Because `enumerate()` returns a structure that looks like a list of `tuple`s under the hood, we can take advantage of tuple unpacking in the `for` loop.
117117

118118
```python
119119
>>> for index, item in enumerate(colors):

website/content/02-introduction-to-python/175-running-code/20-print-tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Value of returned num is: 900
8080
```
8181

8282
{{% notice tip %}}
83-
Tip: As you continue your Python journey, try using a debugger like the built-in `pdb` instead of the `print()` function to really dive into what your code is doing under the hood.
83+
Tip: As you continue your Python journey, try using a debugger, like the built-in `pdb` instead of the `print()` function to really dive into what your code is doing under the hood.
8484
{{% /notice %}}
8585

8686

website/content/02-introduction-to-python/175-running-code/70-exercise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if __name__ == "__main__":
6565
main()
6666
```
6767

68-
A few new things here: first, remember that `enumerate()` outputs a tuple of (index, entry), so we use `index` and `entry` variables to capture those. Then, for ever item in the list, we print the index (+ 1, because zero-indexed lists are sometimes hard to read), and we pull the name and population out of each entry dictionary using the dictionary `[]` syntax.
68+
A few new things here: first, remember that `enumerate()` outputs a tuple of (index, entry), so we use `index` and `entry` variables to capture those. Then, for every item in the list, we print the index (+ 1, because zero-indexed lists are sometimes hard to read), and we pull the name and population out of each entry dictionary using the dictionary `[]` syntax.
6969

7070
{{%expand "Here's what you should have seen on your command line:" %}}
7171

website/content/02-introduction-to-python/190-APIs/00-what-is-an-API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ draft: false
55
weight: 1
66
---
77

8-
Per the dictionary, and API is:
8+
Per the dictionary, an API is:
99

1010
> a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.
1111

website/content/03-intermediate-python/20-advanced-looping/10-list-comprehensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ draft: false
55
weight: 1
66
---
77

8-
List comprehensions are a unique way to create lists in Python. A list comprehension consists of brackets containing and expression followed by a `for` clause, then zero or more `for` or `if` clauses. The expressions can be any kind of Python object. List comprehensions will commonly take the form of `[<value> for <vars> in <iter>]`.
8+
List comprehensions are a unique way to create lists in Python. A list comprehension consists of brackets containing an expression followed by a `for` clause, then zero or more `for` or `if` clauses. The expressions can be any kind of Python object. List comprehensions will commonly take the form of `[<value> for <vars> in <iter>]`.
99

1010
A simple case: Say we want to turn a list of strings into a list of string *lengths.* We could do this with a `for` loop:
1111

0 commit comments

Comments
 (0)