diff --git a/website/content/02-introduction-to-python/020-basic-data-types/00-variables.md b/website/content/02-introduction-to-python/020-basic-data-types/00-variables.md index 5cc98de..382e6cf 100644 --- a/website/content/02-introduction-to-python/020-basic-data-types/00-variables.md +++ b/website/content/02-introduction-to-python/020-basic-data-types/00-variables.md @@ -62,7 +62,7 @@ Convention says that numbers should be named in lower case, with whole words sep 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. {{% /notice %}} -Because Python is a dynamic language and you don't have type hints to explain what's stored inside a variable while reading code, you should do your best naming your variables to describe what is stored inside of them. +Because Python is a dynamic language and you don't have type hints to explain what's stored inside a variable while reading a code, you should do your best naming your variables to describe what is stored inside of them. It's ok to be _verbose_. For example, `n` is a poor variable name, while `numbers` is a better one. If you're storing a collection of items, name your variable as a plural. @@ -84,7 +84,7 @@ If you notice your program behaving oddly and you can't find the source of the b ## Types -Python has a very easy way of determining the type of something. It's the `type()` function. +Python has a very easy way of determining the type of something, with the `type()` function. ```python >>> num = 42 @@ -101,4 +101,4 @@ If you try to examine a variable on the REPL that's been set to `None`, you won' ```python >>> x = None >>> x -``` \ No newline at end of file +``` diff --git a/website/content/02-introduction-to-python/060-functions/10-defining-functions.md b/website/content/02-introduction-to-python/060-functions/10-defining-functions.md index 2abfab5..7a51d73 100644 --- a/website/content/02-introduction-to-python/060-functions/10-defining-functions.md +++ b/website/content/02-introduction-to-python/060-functions/10-defining-functions.md @@ -15,7 +15,7 @@ This is the recipe for defining a Python function: 1. a name for the function 1. `(`: opening parenthesis 1. (optional) the **names** of one or more arguments, separated with `,` -1. (optional) the **names** and **values** of one or more default arguments, separated with (`,`) *note: we'll see these in the next section* +1. (optional) the **names** and **values** of one or more default arguments, separated with (`,`) *note: we'll see this in the next section* 1. `)` closing parenthesis 1. `:` a colon @@ -65,10 +65,10 @@ SyntaxError: invalid syntax The recipe for function contents: -1. a new line -1. indentation (press tab on your keyboard) -1. one or more lines -1. (optional) a `return` statement +1. a new line. +1. indentation (press tab on your keyboard). +1. one or more lines. +1. (optional) a `return` statement. #### `return` statement @@ -204,4 +204,4 @@ Let's try it now. 8 ``` -The variable `new_number` now contains the result of running our `add_numbers` function with our arguments `3` and `8`. \ No newline at end of file +The variable `new_number` now contains the result of running our `add_numbers` function with our arguments `3` and `8`. diff --git a/website/content/02-introduction-to-python/060-functions/30-function-arguments.md b/website/content/02-introduction-to-python/060-functions/30-function-arguments.md index 707970d..cbfdba0 100644 --- a/website/content/02-introduction-to-python/060-functions/30-function-arguments.md +++ b/website/content/02-introduction-to-python/060-functions/30-function-arguments.md @@ -164,7 +164,7 @@ Why? Because it won't work like you'd expect it to. If you need to use a mutable type, like a `list` as a default, use a *marker* instead. We'll cover this technique when we talk about `list`s in the next chapter. -In Python, default arguments are evaluated only once -- when the unction is defined. Not each time the function is called. That means if you use a value that can be changed, it won't behave like you'd expect it to. +In Python, default arguments are evaluated only once -- when the function is defined. Not each time the function is called. That means if you use a value that can be changed, it won't behave like you'd expect it to. ### Naming Functions and Arguments @@ -189,4 +189,4 @@ For example, I'd expect a variable called `name` to be a single string, and a va {{% notice tip %}} A great resource to help you figure out the best naming conventions to use in your production Python code is a talk by Brandon Rhodes, called ["The Naming of Ducks: Where Dynamic Types Meet Smart Conventions"](https://www.youtube.com/watch?v=YklKUuDpX5c). -{{% /notice %}} \ No newline at end of file +{{% /notice %}} diff --git a/website/content/02-introduction-to-python/060-functions/50-exercise.md b/website/content/02-introduction-to-python/060-functions/50-exercise.md index 7cff0ba..4c5aeb0 100644 --- a/website/content/02-introduction-to-python/060-functions/50-exercise.md +++ b/website/content/02-introduction-to-python/060-functions/50-exercise.md @@ -8,7 +8,7 @@ pre: "⭐️ " ## Functions -Let's try creating a basic function. Use tab to intent the second line, and press enter on an empty line to finish the function. +Let's try creating a basic function. Use tab to indent the second line, and press enter on an empty line to finish the function. ```python >>> def add_numbers(x, y): diff --git a/website/content/02-introduction-to-python/080-advanced-datatypes/30-tuples.md b/website/content/02-introduction-to-python/080-advanced-datatypes/30-tuples.md index 209e5ba..4383a3e 100644 --- a/website/content/02-introduction-to-python/080-advanced-datatypes/30-tuples.md +++ b/website/content/02-introduction-to-python/080-advanced-datatypes/30-tuples.md @@ -90,7 +90,7 @@ We'll see `TypeError: 'tuple' object does not support item assignment` if we try ### `tuple` unpacking. -Sounds like a lot of work for not a lot of benefit, right? Not so. `tuple`s are great when you depend on your data staying unchanged. Because of this guarantee, we can use `tuples` in other types of containers like `set`s and `dict`ionaries. +Sounds like a lot of work for not a lot of benefit, right? Not so. `tuple`s are great when you depend on your data staying unchanged. Because of this guarantee, we can use `tuples` in other types of containers like `set`s and `dictionaries`. It's also a great way to quickly consolidate information. @@ -121,4 +121,4 @@ You can return tuples from functions, and use unpacking. 200 >>> value 'OK' -``` \ No newline at end of file +``` diff --git a/website/content/02-introduction-to-python/080-advanced-datatypes/50-sets.md b/website/content/02-introduction-to-python/080-advanced-datatypes/50-sets.md index 553e03b..6b79c24 100644 --- a/website/content/02-introduction-to-python/080-advanced-datatypes/50-sets.md +++ b/website/content/02-introduction-to-python/080-advanced-datatypes/50-sets.md @@ -15,7 +15,7 @@ Sets are a datatype that allows you to store other **immutable** types in an uns | creation | `set()` for an empty set (`{}` makes an empty `dict`) and `{1, 2, 3}` for a set with items in it | | search methods | `item in my_set` | | search speed | Searching for an item in a large set is very fast. | -| common methods | `my_set.add(item)`, `my_set.discard(item)` to remove the item if it's present, `my_set.update(other_set)` | +| common methods | `my_set.add(item)`,to add an item to a set , `my_set.discard(item)` to remove the item if it's present, `my_set.update(other_set)` | | order preserved? | **No**. Items *can't* be accessed by index. | | mutable? | **Yes**. Can add to or remove from `set`s. | | in-place sortable? | **No**, because items aren't ordered. |