Skip to content

Commit

Permalink
deploy: 3761e54
Browse files Browse the repository at this point in the history
  • Loading branch information
pryn-kb committed Aug 30, 2024
1 parent 1a2ae50 commit d7d2ab9
Show file tree
Hide file tree
Showing 46 changed files with 220 additions and 148 deletions.
6 changes: 3 additions & 3 deletions _sources/docs/101/02_variables_and_assignment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"* Cannot contain spaces, quotation marks, or other punctuation.\n",
"* *May* contain an underscore (typically used to separate words in long variable names).\n",
"* Having an underscore at the beginning of a variable name like `_alistairs_real_age` has a special meaning.\n",
" So we won't do that until we understand the convention.\n",
" So we will not do that until we understand the convention.\n",
"* The standard naming convention for variable names in Python is the so-called \"snake case\", \n",
" where each word is separated by an underscore.For example `my_first_variable`."
]
Expand Down Expand Up @@ -140,7 +140,7 @@
},
"source": [
"#### Use meaningful variable names\n",
"Python doesn't care what you call variables as long as they obey the rules (alphanumeric characters and the underscore).\\\n",
"Python does not care what you call variables as long as they obey the rules (alphanumeric characters and the underscore).\\\n",
"As you start to code, you will almost certainly be tempted to use extremely short variables names like `f`. Your fingers will get tired. Your coffee will wear off. You will see other people using variables like `f`. You’ll promise yourself that you’ll definitely remember what `f` means. But you probably won’t.\n",
"\n",
"So, resist the temptation of bad variable names! \n",
Expand Down Expand Up @@ -1048,7 +1048,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
18 changes: 9 additions & 9 deletions _sources/docs/101/03_type_conversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"* Whole numbers may also be stored as floats, e.g. `1.0`, but `1.0` would still be stored as a `float`.\n",
"* Character string (usually called \"string\", `str`): text (but not necessarily only letters).\n",
" * Written in either single quotes or double quotes (as long as they match).\n",
" * The quotation marks aren't printed using `print()`, but may appear when viewing a value in the Jupyter Notebook or other Python interpreter.\n",
" * The quotation marks are not printed using `print()`, but may appear when viewing a value in the Jupyter Notebook or other Python interpreter.\n",
"\n",
"We can use the built-in function `type()` to find out what type a value has.\n",
"\n",
Expand Down Expand Up @@ -195,7 +195,7 @@
"source": [
"Multiplying a character string by an integer _N_ creates a new string that consists of that character string repeated _N_ times (since multiplication is repeated addition).\n",
"\n",
"There are more ways that traditional math operators will work on other data types. There isn't a perfect formula for figuring out what they do, so experimentation is valuable."
"There are more ways that traditional math operators will work on other data types. There is not a perfect formula for figuring out what they do, so experimentation is valuable."
]
},
{
Expand Down Expand Up @@ -234,7 +234,7 @@
"id": "a57da586-53ca-4abe-8387-63479b945e6d",
"metadata": {},
"source": [
"### Strings have a length (but numbers don't)\n",
"### Strings have a length (but numbers do not)\n",
"\n",
"The built-in function `len()` counts the number of characters in a string."
]
Expand Down Expand Up @@ -332,7 +332,7 @@
"id": "571d17c1-e22c-4d91-8c89-a2665ecedeaa",
"metadata": {},
"source": [
"This is not allowed because it's ambiguous: should `1 + '2'` be `3` or `'12'`?\n",
"This is not allowed because it is ambiguous: should `1 + '2'` be `3` or `'12'`?\n",
"\n",
"* Some types can be converted to other types by using the type name as a function."
]
Expand Down Expand Up @@ -659,7 +659,7 @@
"id": "35c28758-d719-4b00-9357-0b3c6bbb7ee0",
"metadata": {},
"source": [
"If the conversion doesn't make sense, however, an error message will occur:"
"If the conversion does not make sense, however, an error message will occur:"
]
},
{
Expand Down Expand Up @@ -713,7 +713,7 @@
":class: dropdown\n",
"\n",
"It would not be so unreasonable to expect the Python `int()` command to convert the string \"3.4\" to 3.4 and an additional type conversion to 3.\\\n",
"After all, Python performs a lot of other magic - isn't that part of its charm?\n",
"After all, Python performs a lot of other magic - is that not part of its charm?\n",
"\n",
"However, Python throws an error. Why? To be consistent, possibly.\n",
"\n",
Expand Down Expand Up @@ -871,7 +871,7 @@
"````{admonition} Solution\n",
":class: dropdown\n",
"\n",
"Depending on requirements it might be important to detect when the number of students per class doesn't divide the number of students evenly.\n",
"Depending on requirements it might be important to detect when the number of students per class does not divide the number of students evenly.\n",
"\n",
"Detect it with the modulo operator (`%`) and test if the remainder that it returns is greater than 0.\n",
"\n",
Expand Down Expand Up @@ -913,7 +913,7 @@
"* Use the built-in function `type()` to find the type of a value.\n",
"* Types control what operations can be done on values.\n",
"* Strings can be added and multiplied.\n",
"* Strings have a length (but numbers don't).\n",
"* Strings have a length (but numbers do not).\n",
"* Preventing Errors: Handling numbers and strings in Python operations.\n",
"* Integers and floats can be mixed freely in operations.\n",
"* Variables only change value when something is assigned to them."
Expand Down Expand Up @@ -948,7 +948,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
16 changes: 8 additions & 8 deletions _sources/docs/101/04_built-in_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
"outputs": [],
"source": [
"# This sentence isn't executed by Python.\n",
"# This sentence is not executed by Python.\n",
"name = 'Python for Absolute Beginners' # Neither is this comment - anything after '#' is ignored."
]
},
Expand All @@ -113,12 +113,12 @@
"\n",
"A function may take zero or more arguments.\n",
"\n",
"We have seen some functions already (like `print()` and `type()`) --- now let's take a closer look.\n",
"We have seen some functions already (like `print()` and `type()`) --- now let us take a closer look.\n",
"* An *argument* is a value passed into a function.\n",
"* Any arguments you want to pass into a function must go into the `()`\n",
" * `print(\"I am an argument and must go here.\")`\n",
"* You must always use parentheses, because this is how Python knows you are calling a function.\n",
" * You leave them empty if you don't want or need to pass any arguments in.\n",
" * You leave them empty if you do not want or need to pass any arguments in.\n",
"* `len()` takes exactly one argument.\n",
"* `int()`, `str()`, and `float()` create a new value from an existing one.\n",
"* `print()` takes zero or more arguments.\n",
Expand Down Expand Up @@ -443,9 +443,9 @@
"\n",
"### Syntax errors\n",
"\n",
"Python reports a syntax error when grammar rules (that's Python grammar, not English grammar) have been violated.\n",
"Python reports a syntax error when grammar rules (that is Python grammar, not English grammar) have been violated.\n",
"\n",
"You've seen errors when you try to use a function incorrectly, but you can also have errors when you use punctuation incorrectly.\n",
"You have seen errors when you try to use a function incorrectly, but you can also have errors when you use punctuation incorrectly.\n",
"\n",
"* Python will run the program up until that point, but if the grammar of that line\n",
" of code has produced an error, then the program will shut down with an error.\n",
Expand Down Expand Up @@ -785,7 +785,7 @@
"source": [
"### <i class=\"fa-solid fa-pencil\"></i> Exercise 3: Why not?\n",
"\n",
"Why don't `max()` and `min()` return `None` when they are given no arguments?\n",
"Why do `max()` and `min()` not return `None` when they are given no arguments?\n",
"\n",
"````{admonition} Solution\n",
":class: dropdown\n",
Expand Down Expand Up @@ -878,7 +878,7 @@
"* Functions may have default values for some arguments.\n",
"* Every function returns something.\n",
"* Use the built-in function `help()` to get help for a function.\n",
"* Python reports a syntax error when it can't understand the source of a program.\n",
"* Python reports a syntax error when it cannot understand the source of a program.\n",
"* Python reports a runtime error when something goes wrong while a program is executing."
]
},
Expand Down Expand Up @@ -915,7 +915,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions _sources/docs/101/05_lists.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
"metadata": {},
"source": [
"```{warning}\n",
"If we don't add an index, the whole list will be deleted!\n",
"If we do not add an index, the whole list will be deleted!\n",
"\n",
"I.e., `del list_name` will delete the whole `list_name`."
]
Expand Down Expand Up @@ -414,7 +414,7 @@
"\n",
"The empty list contains no items.\n",
"\n",
"Use `[]` on its own to represent a list that doesn't contain any items.\n",
"Use `[]` on its own to represent a list that does not contain any items.\n",
"- \"The zero of lists.\"\n",
"\n",
"This is helpful as a starting point for collecting values (which we will see in the next episode about [For Loops](06_for_loops)."
Expand Down Expand Up @@ -584,7 +584,7 @@
"````{admonition} Notice the difference between overwriting and changing values\n",
":class: important\n",
"\n",
"In Python, when you use the assignment operator (`=`) with a variable (*and not a variable index!*), it doesn't change the original value of the variable.\n",
"In Python, when you use the assignment operator (`=`) with a variable (*and not a variable index!*), it does not change the original value of the variable.\n",
"\n",
"Instead, it replaces the current value of the variable with the new value on the right-hand side of the assignment."
]
Expand Down Expand Up @@ -666,7 +666,7 @@
"id": "d5278bb0-974f-4fae-afa8-1c93c545d6ed",
"metadata": {},
"source": [
"We don't overwrite the variable `book_titles` but rather we *change* the content of the zeroth index.\n",
"We do not overwrite the variable `book_titles` but rather we *change* the content of the zeroth index.\n",
"\n",
"Thus, the difference between *immutable* and *mutable* data types."
]
Expand All @@ -684,7 +684,7 @@
"source": [
"## Indexing beyond the end\n",
"\n",
"Indexing beyond the end of the collection is an error. Therefore, python reports an `IndexError` if we attempt to access a value that doesn't exist.\n",
"Indexing beyond the end of the collection is an error. Therefore, python reports an `IndexError` if we attempt to access a value that does not exist.\n",
"\n",
"* This is a kind of [runtime error](04_built-in_functions)."
]
Expand Down Expand Up @@ -1435,7 +1435,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions _sources/docs/101/06_for_loops.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"source": [
"* The variable name (here `animal`) is a name that you choose, when you create the for loop.\n",
"* You can choose any variable name you want.\n",
"* But don't use an already existing variable name, as this will then be overwritten.\n",
"* But do not use an already existing variable name, as this will then be overwritten.\n",
"* The variable persists after the loop is done and will contain the last used value.\n",
"* In the case above, `animal` will contain the string \"whale\" after the for loop is finished."
]
Expand Down Expand Up @@ -410,7 +410,7 @@
"* Often be used in the course of the loop.\n",
"* Persist after the loop finishes.\n",
"\n",
"So give them a meaningful name you'll understand as the body code in your loop grows.\n",
"So give them a meaningful name you will understand as the body code in your loop grows.\n",
"Example: `for single_letter in ['A', 'B', 'C', 'D']:` instead of `for asdf in ['A', 'B', 'C', 'D']:`.\n",
"\n",
"Use a new variable name to avoid overwriting a data collection you need to keep for later."
Expand Down Expand Up @@ -579,7 +579,7 @@
"source": [
"Or use `range` to repeat an action a set number of times.\n",
"\n",
"You don't actually have to use the iterable variable's value. Use this structure to simply repeat an action some number of times.\n",
"You do not actually have to use the iterable variable's value. Use this structure to simply repeat an action some number of times.\n",
"\n",
"That number of times goes into the `range` function."
]
Expand Down Expand Up @@ -1321,7 +1321,7 @@
"IndexError: list index out of range\n",
"```\n",
"\n",
"The problem is that `4` points to an item that doesn't exist in the list. Remember the first item of a list in Python is `0`. \n",
"The problem is that `4` points to an item that does not exist in the list. Remember the first item of a list in Python is `0`. \n",
"Replace `seasons[4]` with `seasons[0]`, `seasons[1]`, `seasons[2]`, or `seasons[3]` to have the different items of the list printed."
]
},
Expand Down Expand Up @@ -1394,7 +1394,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion _sources/docs/101/07_conditionals.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
10 changes: 9 additions & 1 deletion _sources/docs/101/part1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
"Remember that all the notebooks [can be downloaded](../howto/interact) so you can work with them on your own.\n"
]
},
{
"cell_type": "markdown",
"id": "d9c39318-c715-44bb-a38d-b745d5b8d209",
"metadata": {},
"source": [
"___"
]
},
{
"cell_type": "markdown",
"id": "9614a088-79fc-4467-a92f-6f70853bb7e0",
Expand Down Expand Up @@ -82,7 +90,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
12 changes: 10 additions & 2 deletions _sources/docs/101/part2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@
"source": [
"Python for Absolute Beginners, Part 2.\n",
"\n",
"In this second part of our introduction to Python, you will build on the foundations from Part 1 to start writing short scripts. By the end of this course, you'll even have the opportunity to create a small game!\n",
"In this second part of our introduction to Python, you will build on the foundations from Part 1 to start writing short scripts. By the end of this course, you will even have the opportunity to create a small game!\n",
"\n",
"To participate in this course, it is essential that you either have completed Part 1 or possess an understanding of the topics covered there. This will ensure that you are well prepared to take full advantage of the more advanced concepts in Part 2."
]
},
{
"cell_type": "markdown",
"id": "b3aad51e-f17c-4f24-b153-2dc4df9a4206",
"metadata": {},
"source": [
"___"
]
},
{
"cell_type": "markdown",
"id": "e33d6477-5a55-4bf2-b3a2-0d3af1b072fe",
Expand Down Expand Up @@ -78,7 +86,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions _sources/docs/howto/dictionary_101.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"source": [
"## Float\n",
"\n",
"A float (short for \"floating-point number\") is a type of number that can have a decimal point. It's used to represent real numbers that require precision beyond whole numbers, including fractions.\n",
"A float (short for \"floating-point number\") is a type of number that can have a decimal point. It is used to represent real numbers that require precision beyond whole numbers, including fractions.\n",
"\n",
"Example: `3.4` is a float"
]
Expand Down Expand Up @@ -310,7 +310,7 @@
"source": [
"## Library\n",
"\n",
"A collection of pre-written code that provides useful functions and modules for performing common tasks, so you don't have to write the code from scratch. \n",
"A collection of pre-written code that provides useful functions and modules for performing common tasks, so you do not have to write the code from scratch. \n",
"\n",
"Example: The Pandas library which is used in one of our more advanced courses."
]
Expand Down Expand Up @@ -469,7 +469,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions _sources/docs/howto/dictionary_pandas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"source": [
"## Series\n",
"\n",
"A `Series` in Pandas is like a list of values in a single column, where each value has a unique label called an index. It's a simple way to store and manage a sequence of data.\n",
"A `Series` in Pandas is like a list of values in a single column, where each value has a unique label called an index. It is a simple way to store and manage a sequence of data.\n",
"It is a 1-dimensional labeled array capable of holding any data type.\n",
"\n",
"Example:\n",
Expand Down Expand Up @@ -177,7 +177,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit d7d2ab9

Please sign in to comment.