Skip to content

Commit

Permalink
Baseline - 2
Browse files Browse the repository at this point in the history
Final QA and spellcheck.
  • Loading branch information
geozeke committed Jun 24, 2020
1 parent 74c9321 commit 2638018
Show file tree
Hide file tree
Showing 33 changed files with 330 additions and 380 deletions.
107 changes: 53 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,78 @@ This is a collection of Jupyter Notebooks for teaching Python programming with a

## Topics

1. Introduction
* Using Jupyter notebooks
* Your First Python Program
1. Introduction
* Using Jupyter notebooks
* Your First Python Program


2. Basic operations
* Variables, Assignment Statements, Expressions
* Reading console input
* Numeric Data Types
* Operator Precedence
* Strings
* Type Conversions
2. Basic operations
* Variables, Assignment Statements, Expressions
* Reading console input
* Numeric Data Types
* Operator Precedence
* Strings
* Type Conversions


3. Built-in Functions and Objects
* Common Functions
* Objects and Methods
* Formatting output with `.format()`
3. Built-in Functions and Objects
* Common Functions
* Objects and Methods
* Formatting output with `.format()`


4. Branch Logic
* Boolean Data Types
* `if` Statements
* `if` - `else` Statements
* `if` - `elif` - `else` Statements
* Logical operators (`and`, `or`, `not`)
* Operator Precedence
4. Branch Logic
* Boolean Data Types
* `if` Statements
* `if` - `else` Statements
* `if` - `elif` - `else` Statements
* Logical operators (`and`, `or`, `not`)
* Operator Precedence


5. Iteration (Loops)
* `for` Loop
* `while` Loop
* Nested Loops
* `break` and `continue`
5. Iteration (Loops)
* `for` Loop
* `while` Loop
* Nested Loops
* `break` and `continue`


6. User Defined Functions
* Introduction
* Defining Functions
* Calling Functions
* Arguments and Parameters
* Variable Scope
6. User Defined Functions
* Introduction
* Defining Functions
* Calling Functions
* Arguments and Parameters
* Variable Scope


7. Collections: Lists, Dictionaries, Sets, Tuples
* Creating
* Accessing Data
* Functions - Returning Multiple Values
* Functions - Pass by Value; Pass by Reference
7. Collections: Lists, Dictionaries, Sets, Tuples
* Creating
* Accessing Data
* Functions - Returning Multiple Values
* Functions - Pass by Value; Pass by Reference


8. File I/O
* Modes: read (`'r'`), write (`'w'`), append(`'a'`)
* Ways to Read: `read()`, `readline()`, `readlines()`
* Writing and Closing: `write()`, `close()`
8. File I/O
* Modes: read (`'r'`), write (`'w'`), append(`'a'`)
* Ways to Read: `read()`, `readline()`, `readlines()`
* Writing and Closing: `write()`, `close()`


9. Hashing
* Hashing Strings
9. Hashing
* Hashing Strings


10. Exception Handling
* Catching exceptions
* Raising exceptions


11. Recursion
* Introduction
* Examples
10. Exception Handling
* Catching exceptions
* Raising exceptions

11. Recursion
* Introduction
* Examples


12. OOP
* User-defined Classes
12. OOP
* User-defined Classes


13. Misc Topics
13. Misc Topics
107 changes: 53 additions & 54 deletions content/00_tableOfContents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,82 +10,81 @@
"\n",
"## Topics\n",
"\n",
"1. Introduction\n",
" * Using Jupyter notebooks\n",
" * Your First Python Program\n",
"1. Introduction\n",
" * Using Jupyter notebooks\n",
" * Your First Python Program\n",
" \n",
" \n",
"2. Basic operations\n",
" * Variables, Assignment Statements, Expressions\n",
" * Reading console input\n",
" * Numeric Data Types\n",
" * Operator Precedence\n",
" * Strings\n",
" * Type Conversions\n",
"2. Basic operations\n",
" * Variables, Assignment Statements, Expressions\n",
" * Reading console input\n",
" * Numeric Data Types\n",
" * Operator Precedence\n",
" * Strings\n",
" * Type Conversions\n",
" \n",
" \n",
"3. Built-in Functions and Objects\n",
" * Common Functions\n",
" * Objects and Methods\n",
" * Formatting output with `.format()`\n",
"3. Built-in Functions and Objects\n",
" * Common Functions\n",
" * Objects and Methods\n",
" * Formatting output with `.format()`\n",
" \n",
" \n",
"4. Branch Logic\n",
" * Boolean Data Types\n",
" * `if` Statements\n",
" * `if` - `else` Statements\n",
" * `if` - `elif` - `else` Statements\n",
" * Logical operators (`and`, `or`, `not`)\n",
" * Operator Precedence\n",
"4. Branch Logic\n",
" * Boolean Data Types\n",
" * `if` Statements\n",
" * `if` - `else` Statements\n",
" * `if` - `elif` - `else` Statements\n",
" * Logical operators (`and`, `or`, `not`)\n",
" * Operator Precedence\n",
" \n",
" \n",
"5. Iteration (Loops)\n",
" * `for` Loop\n",
" * `while` Loop\n",
" * Nested Loops\n",
" * `break` and `continue`\n",
"5. Iteration (Loops)\n",
" * `for` Loop\n",
" * `while` Loop\n",
" * Nested Loops\n",
" * `break` and `continue`\n",
" \n",
"\n",
"6. User Defined Functions\n",
" * Introduction\n",
" * Defining Functions\n",
" * Calling Functions\n",
" * Arguments and Parameters\n",
" * Variable Scope\n",
"6. User Defined Functions\n",
" * Introduction\n",
" * Defining Functions\n",
" * Calling Functions\n",
" * Arguments and Parameters\n",
" * Variable Scope\n",
" \n",
" \n",
"7. Collections: Lists, Dictionaries, Sets, Tuples\n",
" * Creating\n",
" * Accessing Data\n",
" * Functions - Returning Multiple Values\n",
" * Functions - Pass by Value; Pass by Reference\n",
"7. Collections: Lists, Dictionaries, Sets, Tuples\n",
" * Creating\n",
" * Accessing Data\n",
" * Functions - Returning Multiple Values\n",
" * Functions - Pass by Value; Pass by Reference\n",
"\n",
" \n",
"8. File I/O\n",
" * Modes: read (`'r'`), write (`'w'`), append(`'a'`)\n",
" * Ways to Read: `read()`, `readline()`, `readlines()`\n",
" * Writing and Closing: `write()`, `close()`\n",
"8. File I/O\n",
" * Modes: read (`'r'`), write (`'w'`), append(`'a'`)\n",
" * Ways to Read: `read()`, `readline()`, `readlines()`\n",
" * Writing and Closing: `write()`, `close()`\n",
" \n",
"\n",
"9. Hashing\n",
" * Hashing Strings\n",
"9. Hashing\n",
" * Hashing Strings\n",
"\n",
"\n",
"10. Exception Handling\n",
" * Catching exceptions\n",
" * Raising exceptions\n",
"\n",
"\n",
"11. Recursion\n",
" * Introduction\n",
" * Examples\n",
"10. Exception Handling\n",
" * Catching exceptions\n",
" * Raising exceptions\n",
" \n",
"11. Recursion\n",
" * Introduction\n",
" * Examples\n",
"\n",
"\n",
"12. OOP\n",
" * User-defined Classes\n",
"12. OOP\n",
" * User-defined Classes\n",
"\n",
"\n",
"13. Misc Topics"
"13. Misc Topics\n"
]
},
{
Expand Down
16 changes: 7 additions & 9 deletions content/01_intro00.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
"source": [
"### Quickstart Guide for Jupyter Notebooks:\n",
"\n",
"* Jupyter Notebooks are arranged as a collection of \"cells\". Cells can contain instructions / descriptions or code.\n",
"* Jupyter Notebooks are arranged as a collection of \"cells\". Cells can contain descriptions or code.\n",
"* A cell is selected if you see a blue bar to its left.\n",
"* To minimize a cell, click once on its blue bar. Click the blue bar again to expand.\n",
"* To edit a code cell, click on it.\n",
"* To run a code cell, make sure it's selected and press **Cntl-Enter**.\n",
" * You can repeatedly run a cell as long as it's highlighted. Each re-run of a cell will start by clearing its output.\n",
"* To clear the output in a code cell: Right-click it; select **Clear Outputs**.\n",
"* To clear the output for all code cells in a notebook, right-click on the window and select **Clear All Outputs**\n",
"* If a particular code cell appears to \"hang\" or won't run, select **Restart Kernel...** from the **Kernel** menu."
"* To clear the output for all code cells in a notebook, right-click on the window and select **Clear All Outputs**"
]
},
{
Expand All @@ -34,7 +33,7 @@
"<img src=\"../images/00check.png\" align=\"left\" />\n",
"<br clear=\"all\" />\n",
"\n",
"Throughout these notebooks, you'll occasionally see a green check mark like the one shown above. These are knowledge checkpoints intended to test your skills and understanding of the material. They usually involve asking a question before having you run a snippet of code to check your answer.\n",
"Throughout these notebooks you'll occasionally see a green check mark like the one shown above. These are knowledge checkpoints intended to test your skills and understanding of the material. They usually involve asking a question before having you run a snippet of code to check your answer.\n",
"<hr>"
]
},
Expand All @@ -51,7 +50,6 @@
"metadata": {},
"source": [
"- To run the code below, click (once) on the code block, hold the `Control` key and press the `Enter` key (`Cntl-Enter`).\n",
"- This code example is interactive and will ask you for input.\n",
"- To re-run the code, press `Cntl-Enter` again.\n",
"- To clear the output, right-click on the cell and select `Clear Outputs`"
]
Expand Down Expand Up @@ -87,7 +85,7 @@
"source": [
"### If Code Cells Won't Clear or Run\n",
"\n",
"Occasionally jupyter lab will appear to \"hang\" when running a code cell. This is often because some code in the backround is waiting for input or is dealing with an error condition. Take the example below, which prints `Hello`, then goes into a loop that runs forever (what's called an [infinite loop](https://en.wikipedia.org/wiki/Infinite_loop)). As a result, `Goodbye` never prints to the screen and jupyter lab appears to be unresponsive; no other code cells will run.\n",
"Occasionally jupyter lab will appear to \"hang\" when running a code cell. This is often because some code in the background is waiting for input or is dealing with an error condition. Take the example below, which prints `Hello`, then goes into a loop that runs forever (what's called an [infinite loop](https://en.wikipedia.org/wiki/Infinite_loop)). As a result, `Goodbye` never prints to the screen and jupyter lab appears to be unresponsive; no other code cells will run.\n",
"\n",
"Try running the code cell below. You should see `Hello` print to the screen, then nothing. Clear the cell and try to run it again. Notice that nothing happens. You'll know that the cell is unresponsive because you'll see an asterisk next to the top of the cell. If that happens, just press the *Interrupt the kernel* button (small square at the top of the window) to reset it."
]
Expand Down Expand Up @@ -117,11 +115,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### If You Accidently Double-click a Text Cell\n",
"### If You Accidentally Double-click a Text Cell\n",
"\n",
"Don't worry :-)\n",
"\n",
"If you double-click a text cell you put it in *edit mode*. Text cells are written in a language called [markdown](https://www.markdownguide.org/getting-started/) and double-clicking on one allows you to edit the underlying content. If you accidently double-click on one, just \"run\" the cell like you would a code cell (holding the `Control` key and pressing the `Enter` key). This will put it back into *display mode*. Go ahead and try it. Double-click this cell to enter *edit mode*, then press `Control-Enter` to put it back into *display mode*.\n",
"If you double-click a text cell you put it in *edit mode*. Text cells are written in a language called [markdown](https://www.markdownguide.org/getting-started/) and double-clicking on one allows you to edit the underlying content. If you accidentally double-click on one, just \"run\" the cell like you would a code cell (holding the `Control` key and pressing the `Enter` key). This will put it back into *display mode*. Go ahead and try it. Double-click this cell to enter *edit mode*, then press `Control-Enter` to put it back into *display mode*.\n",
"\n",
"You shouldn't have a need to manipulate text cells in these notebooks, but if you put one in *edit mode* by mistake, now you know how to put it back into *display mode*."
]
Expand All @@ -145,7 +143,7 @@
"source": [
"## Additional Resources\n",
"\n",
"There is so much more to Jupyter Notebooks than what's listed above, but it will get you started. Trying Googling \"Jupyter Notebooks\", or check out some of these resources:\n",
"There is so much more to Jupyter Notebooks than what's listed above, but it will get you started. Trying Googling `Jupyter Notebooks`, or check out some of these resources:\n",
"\n",
"*NOTE: Jupyter Lab is the next evolution of the Jupyter infrastructure. The basic program (jupyter notebook) started it all.*\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions content/01_intro01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"<img src=\"../images/00check.png\" align=\"left\" />\n",
"<br clear=\"all\" />\n",
"\n",
"Do you remember how to run a code cell? Visit the first jupyter notebook if you need a refresher. To test your knowledge, run the code cell above and observe the output. Then modify the program to print your name, rather than `Hello World` and run it again."
"Do you remember how to run a code cell? Visit [this jupyter notebook](./01_intro00.ipynb) if you need a refresher. To test your knowledge, run the code cell above and observe the output. Then modify the program to print your name, rather than `Hello World` and run it again."
]
},
{
Expand All @@ -49,7 +49,7 @@
"source": [
"While this first program is very simple, it introduces an important concept: Having Python print information to the screen. A computer program that only calculated results, but never provided them to you would not be very useful.\n",
"\n",
"In the first notebook we introduced this Python program:"
"In the [first notebook](01_intro00.ipynb) we introduced this Python program:"
]
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@
"\n",
"Python is quite forgiving about how things are spaced-out. If often comes down to readability. Can you (or your instructor) easily read your code and follow along? While the program may run just fine, be mindful that you can change the intended result because of the particular spacing you used.\n",
"\n",
"Here are some examples:"
"Below are some examples. Run them and observe the outputs."
]
},
{
Expand Down
Loading

0 comments on commit 2638018

Please sign in to comment.