Skip to content

Commit 0092122

Browse files
nnjaJim-HornChidinmaKOchristiannwambaloki-one
authored
Batching minor fixes and typo corrections into one PR (#96)
* Update 00-who.md * add correction to minor typos * Update workshop website link in readme body * Typo correction * Update 20-adding-removing-finding.md I think that you wanted to state that one can call help on the variable that's already a list, instead of the type itself (?) * Typos in 04-the-repl-in-vscode.md Changed "type" to "directory" (but could possibly also just be "dir" here) and add the word "pass" to a sentence under the help() section. * Typos in Best Practices - 02-brief-history.md Just fixing a few small typos. * Typos in 020-basic-data-types / 00-variables.md Just a few minor typos * Update 50-sets.md * Update 65-mutability.md values in a python should be immutable * Update 60-dictionaries.md Remove unnecessary quotation mark * Fix typo. reccomended -> recommended * Update 00-variables.md * Fix typo ^ character is called caret. https://en.wikipedia.org/wiki/Caret * Fixed Grammatical Error * fix mistype Co-authored-by: Jim Horn <[email protected]> Co-authored-by: ChidinmaKO <[email protected]> Co-authored-by: Christian Nwamba <[email protected]> Co-authored-by: Lokesh Jadhav <[email protected]> Co-authored-by: Daniel Silva <[email protected]> Co-authored-by: Marc Johlic <[email protected]> Co-authored-by: trufkin <[email protected]> Co-authored-by: Eric Dai <[email protected]> Co-authored-by: Matilda Smeds <[email protected]> Co-authored-by: Kim Brandl <[email protected]> Co-authored-by: Adeyemi Ridwan <[email protected]> Co-authored-by: sherry808 <[email protected]> Co-authored-by: Itamar Held <[email protected]>
1 parent 1acec4c commit 0092122

File tree

14 files changed

+26
-26
lines changed

14 files changed

+26
-26
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ These are the resources for Nina Zakharenko's Python Fundamentals and Intermedia
66

77
The majority of the content can be found on the course website.
88

9-
* [Course Website - learnpython.netlify.com](https://learnpython.netlify.com)
9+
* [Course Website - https://www.learnpython.dev](https://www.learnpython.dev)
1010
* [This Repo - git.io/python3](https://git.io/python3)
1111
* [Follow Nina on Twitter](https://twitter.com/nnja)
1212

website/content/01-introduction/00-who.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ draft: false
1010
{{< figure src="/images/me.jpg" width="20%" title="Nina Zakharenko" >}}
1111
</a>
1212

13-
Hi, I'm Nina Zakharenko. I'm a Senior Cloud Developer Advocate and Microsoft, focusing on Python. Before Microsoft, I wrote code for other cool companies like Reddit, Meetup, and HBO. In my spare time I like drinking scotch and tinkering with wearable electronics. I enjoy hiking and snowboarding from my home base in Portland, Oregon. I change my hair color regularly.
13+
Hi, I'm Nina Zakharenko. I'm a Senior Cloud Developer Advocate at Microsoft, focusing on Python. Before Microsoft, I wrote code for other cool companies like Reddit, Meetup, and HBO. In my spare time I like drinking scotch and tinkering with wearable electronics. I enjoy hiking and snowboarding from my home base in Portland, Oregon. I change my hair color regularly.
1414

1515

1616
I've been involved in the Python community for approximately 6 years. During that time I've spoken at multiple Python conferences on a variety of topics, including PyCon US, PyParis, DjangoCon, and even PyCon Russia in Moscow.

website/content/01-introduction/02-requirements/05-vs-code/04-the-repl-in-vscode.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ For example, in the REPL, let's make a new variable `name`, and check its `type`
9090
We'll see that the type is `str`, Python's version of a string. Now that we know this object's type, we can
9191
pass the type into other methods.
9292

93-
The first one is `dir()` which stands for directory. If we check the type of `str` (notice, no quotes here)) in the REPL, we'll see all the methods available on strings in Python. Don't worry about these for now, we'll use them later in the day.
93+
The first one is `dir()` which stands for directory. If we check the directory of `str` (notice, no quotes here)) in the REPL, we'll see all the methods available on strings in Python. Don't worry about these for now, we'll use them later in the day.
9494

9595
```Python
9696
>>> dir(str)
9797
['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
9898
```
9999

100-
The next useful method is `help()`. You can a type, method, or other object to help to instantly see available documentation about the method, the parameters it expects, and what it returns.
100+
The next useful method is `help()`. You can pass a type, method, or other object to help to instantly see available documentation about the method, the parameters it expects, and what it returns.
101101

102102
Let's try this in the REPL, and look up the documentation for the `isupper` method in String. We access it with the period symbol (`.`). This is called dot-notation.
103103

website/content/02-introduction-to-python/010-Best-Practices/02-brief-history.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ You might be surprised to learn that Python is 30 years old!
1313

1414
### Where is it used?
1515

16-
A common misconception that Python is a scripting language. It's used at companies from Reddit, to Netflix, to Dropbox.
16+
A common misconception is that Python is a scripting language. It's used at companies from Reddit, to Netflix, to Dropbox.
1717

1818
### What's all this about Python 2 vs Python 3
1919

20-
This part is a bit of a stain on Pythons history. Python 3 was released 2008, and its adoption was slow. First and foremost because it took popular packages a fair amount of time to port over their code.
20+
This part is a bit of a stain on Python's history. Python 3 was released 2008, and its adoption was slow. First and foremost because it took popular packages a fair amount of time to port over their code.
2121

2222
This debate is now over. Python 2 will reach end-of-life in 2020, meaning that important updates - including security updates - will stop being released. That's why this course focuses on *Python3 only*.
2323

@@ -56,4 +56,4 @@ The biggest yearly conference is [PyCon US](https://us.pycon.org) with approxima
5656

5757
There are many local user groups worldwide, with many listed on [this wiki](https://wiki.python.org/moin/LocalUserGroups).
5858

59-
There are many supportive groups for women and non-binary developers, such as [PyLadies](https://www.pyladies.com/) and [DjangoGirls](https://djangogirls.org/). These organizations have chapters in most major cities.
59+
There are many supportive groups for women and non-binary developers, such as [PyLadies](https://www.pyladies.com/) and [DjangoGirls](https://djangogirls.org/). These organizations have chapters in most major cities.

website/content/02-introduction-to-python/020-basic-data-types/00-variables.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ weight: 1
77

88
### Naming Variables
99

10-
Python variables can't start with with a number. In general, they're named all lower case, separated by underscores. Unlike other languages, that name their variables with camelCase.
10+
Python variables can't start with a number. In general, they're named all lower case, separated by underscores. Unlike other languages, that name their variables with camelCase.
1111

1212
You don't want to name your variables the same as the *types* that we'll be working with. For example **don't** name your variables `int`, `list`, `dict`. Etc.
1313

@@ -56,7 +56,7 @@ When creating variables, there are a few best practices you should follow.
5656

5757
#### Naming Variables
5858

59-
Convention says that numbers should be named in lower case, with whole words separated by underscores.
59+
Convention says that variables should be named in lowercase, with whole words separated by underscores.
6060

6161
{{% notice note %}}
6262
If you want to learn more about Python naming conventions look at [PEP8](https://www.python.org/dev/peps/pep-0008/#naming-conventions) during a break.
@@ -84,7 +84,7 @@ If you notice your program behaving oddly and you can't find the source of the b
8484

8585
## Types
8686

87-
Python has a very easy way of determining the type of something. It's the `type()` function.
87+
Python has a very easy way of determining the type of something, with the `type()` function.
8888

8989
```python
9090
>>> num = 42
@@ -101,4 +101,4 @@ If you try to examine a variable on the REPL that's been set to `None`, you won'
101101
```python
102102
>>> x = None
103103
>>> x
104-
```
104+
```

website/content/02-introduction-to-python/080-advanced-datatypes/20-adding-removing-finding.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ insert(self, index, object, /)
7676
Insert object before index.
7777
```
7878

79-
You can also call help on `list.insert`. Because `names` is already of type `list`, it achieves the same result.
79+
You can also call help on `names.insert`. Because `names` is already of type `list`, it achieves the same result.
8080

8181
##### `my_list.extend(other_list)` adds all the contents of `other_list` to `my_list`
8282

@@ -116,7 +116,7 @@ False
116116
Notice that only the *first* index of the string `"Nina"` is returned. We'll learn more about what an index is in the next chapter.
117117

118118
{{% notice info %}}
119-
If the item we're looking for *is not* in the list, Python with throw a `ValueError`.
119+
If the item we're looking for *is not* in the list, Python will throw a `ValueError`.
120120
{{% /notice %}}
121121

122122
You'll learn how to deal with exceptions later. For now, you can use the `in` operator to check if an item is present in the list before finding its index.

website/content/02-introduction-to-python/080-advanced-datatypes/50-sets.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Your set will update with each character of the `str`ing, which was probably not
197197
|--------------------- |------------------ |------------------------------------------------------------------------------- |
198198
| `s.union(t)` | <code>s &#124; t</code> | creates a new set with all the items **from both `s` and `t`** |
199199
| `s.intersection(t)` | `s & t` | creates a new set containing *only* items that are **both in `s` and in `t`** |
200-
| `s.difference(t)` | `s ^ t` | creates a new set with items **in `s` but not in `t`** |
200+
| `s.difference(t)` | `s ^ t` | creates a new set containing items that are **not in both `s` and in `t`** |
201201

202202
#### examples
203203

website/content/02-introduction-to-python/080-advanced-datatypes/60-dictionaries.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ If you try to put a key into a dictionary that's already there, you'll just end
142142

143143
>>> nums[8] = "oops, overwritten"
144144
>>> nums
145-
{1: 'one', 2: 'two', 3: 'three', 8: ', overwritten'}
145+
{1: 'one', 2: 'two', 3: 'three', 8: 'oops, overwritten'}
146146
>>> 8 in nums
147147
True
148148
```
@@ -178,7 +178,7 @@ There are three useful methods you need to remember about `dict`ionary access:
178178

179179
1. `my_dict.keys()`
180180
2. `my_dict.values()`
181-
3. `'my_dict.items()`
181+
3. `my_dict.items()`
182182

183183
#### 1. `my_dict.keys()` Getting all the keys in a dictionary
184184

@@ -204,4 +204,4 @@ Notice that `my_dict.items()` returns a type that looks like a list. It contains
204204
>>> nums = {1: 'one', 2: 'two', 3: 'three', 8: 'eight'}
205205
>>> nums.items()
206206
dict_items([(1, 'one'), (2, 'two'), (3, 'three'), (8, 'eight')])
207-
```
207+
```

website/content/02-introduction-to-python/080-advanced-datatypes/65-mutability.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ For the mutability of the container types we covered in this chapter, check this
2626
| container type | use | mutable? |
2727
|---------------- |--------------------------------------------------------------------------------------------------------- |---------- |
2828
| `list` | ordered group of items, accessible by position | **yes** |
29-
| `set` | unordered group of mutable items. useful for set operations (membership, intersection, difference, etc) | **yes** |
29+
| `set` | mutable unordered group consisting only of immutable items. useful for set operations (membership, intersection, difference, etc) | **yes** |
3030
| `tuple` | contain ordered groups of items in an **immutable** collection | **no** |
31-
| `dict` | contains key value pairs | **yes** |
31+
| `dict` | contains key value pairs | **yes** |

website/content/02-introduction-to-python/190-APIs/final-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Let's review what we learned today and put it all together.
1111
For the final exercise of today, we're going to write a small program that requests the top repositories from GitHub, ordered by the number of stars each repository has, then we're going to print the results to our terminal. Create a new file called `day_one.py`.
1212

1313
{{% notice note %}}
14-
You may need to install the `requests` library using `python -m pip install requests`. You may see `pip` used directly, but using `python -m pip` is [reccomended by Python](https://docs.python.org/3/installing/index.html).
14+
You may need to install the `requests` library using `python -m pip install requests`. You may see `pip` used directly, but using `python -m pip` is [recommended by Python](https://docs.python.org/3/installing/index.html).
1515
{{% /notice %}}
1616

1717
Let's start with our key function, the one that gets the data from the [GitHub API](https://developer.github.com/v3/search/). Use the `requests` library to do a GET request on the GitHub search API URL ("https://api.github.com/search/repositories"). Use `if __name__ == "__main__"` to check to make sure we're running the file directly, and to call our function. Don't forget to `import requests`

website/content/03-intermediate-python/10-introduction/15-converting-between-types/10-exercise.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Oops, that wasn't quite what we wanted. Running any object through `str()` will
8484
>>> '-'.join(my_list)
8585
```
8686

87-
Another common way of converting a list to a string is with the string's `split()` method. This is useful for lightweight parsing of, for example, CSV (comma separated value) data.
87+
Another common way of converting a string into a list is with the string's `split()` method. This is useful for lightweight parsing of, for example, CSV (comma separated value) data.
8888

8989
```python
9090
>>> my_string = "the,quick,brown,fox"
@@ -117,4 +117,4 @@ Another common way of converting a list to a string is with the string's `split(
117117
['the', 'quick', 'brown', 'fox']
118118
```
119119

120-
{{%/expand%}}
120+
{{%/expand%}}

website/content/03-intermediate-python/40-exceptions/10-all-about-exceptions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ So, if you wanted to catch a divide-by-zero error, you could use `except ZeroDiv
3838

3939
## Exiting your Program
4040

41-
As we mentioned, exceptions that are allowed to bubble up to the top level (called *unhandled* exceptions) will cause your program to exit. This is generally unwanted - even if an error in unrecoverable, we still want to provide more detailed information about the error for later inspection, or a pretty error for the user if our program is user-facing, and in most cases, we want the program to go back to doing what it was doing.
41+
As we mentioned, exceptions that are allowed to bubble up to the top level (called *unhandled* exceptions) will cause your program to exit. This is generally unwanted - even if an error is unrecoverable, we still want to provide more detailed information about the error for later inspection, or a pretty error for the user if our program is user-facing, and in most cases, we want the program to go back to doing what it was doing.
4242

4343
What if we want our program to stop, though? You may already be familiar with `ctrl-c`, the age-old posix method of sending SIGINT (an interrupt signal) to a program. You may be surprised to know asking your operating system to send SIGINT to Python causes, yes, an exception - `KeyboardInterrupt`. And yes, you can catch `KeyboardInterrupt`, but this will make your program a little harder to kill.
4444

website/content/03-intermediate-python/40-exceptions/30-try-except-else-finally.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ A basic example looks like this:
1616
... print("That number was invalid")
1717
```
1818

19-
First, the `try` clause is executed. If no exception occurs, the `except` clause is skipped and execution of the `try` statement is finished. If an exception occurs in the `try` clause, the rest of the clause is skipped. If the the exception's type matches the exception named after the `except` keyword, then the `except` clause is executed. If the exception doesn't match, then the exception is *unhandled* and execution stops.
19+
First, the `try` clause is executed. If no exception occurs, the `except` clause is skipped and execution of the `try` statement is finished. If an exception occurs in the `try` clause, the rest of the clause is skipped. If the exception's type matches the exception named after the `except` keyword, then the `except` clause is executed. If the exception doesn't match, then the exception is *unhandled* and execution stops.
2020

2121

2222
### The `except` Clause
2323

24-
An `except` clause my have multiple exceptions, given as a parenthesized tuple:
24+
An `except` clause may have multiple exceptions, given as a parenthesized tuple:
2525

2626
```python
2727
try:

website/content/03-intermediate-python/40-exceptions/99-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ IndentationError: expected an indented block
2121

2222
Notice that we started a new function scope with the `def` keyword, but didn't indent the next line of the function, the `print()` argument.
2323

24-
You've probably also seen the more general `SyntaxError`. This one's probably obvious - something is misspelled, or the syntax is otherwise wrong. Python gives us a helpful little carrot `^` under the earliest point where the error was detected, however you'll have to learn to read this with a critical eye as sometimes the actual mistake precedes the invalid syntax. For example:
24+
You've probably also seen the more general `SyntaxError`. This one's probably obvious - something is misspelled, or the syntax is otherwise wrong. Python gives us a helpful little caret `^` under the earliest point where the error was detected, however you'll have to learn to read this with a critical eye as sometimes the actual mistake precedes the invalid syntax. For example:
2525

2626
```python
2727
>>> a = [4,

0 commit comments

Comments
 (0)