diff --git a/Python Absolute Beginner/Module_1.0_Tutorials_START_HERE.ipynb b/Python Absolute Beginner/Module_1.0_Tutorials_START_HERE.ipynb
index d5f4911..5057bc8 100644
--- a/Python Absolute Beginner/Module_1.0_Tutorials_START_HERE.ipynb
+++ b/Python Absolute Beginner/Module_1.0_Tutorials_START_HERE.ipynb
@@ -8,7 +8,7 @@
}
},
"source": [
- "# Module 1 Introduction to Application Development Using Python\n",
+ "# Absolute Beginner Module 1 Introduction (P1M1)\n",
"## Getting started with Python in Jupyter Notebooks\n",
"- **Python 3 in Jupyter notebooks**\n",
"- **`print()`**\n",
@@ -49,9 +49,7 @@
}
},
"source": [
- "## Watch this \"Hello World! video and run the examples below as they are shown.\" \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/6f5784c6-eece-4dfe-a14e-9dcf6ee81a7f/Unit1_Section1.1-Hello_World.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/6f5784c6-eece-4dfe-a14e-9dcf6ee81a7f/Unit1_Section1.1-Hello_World.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
+ "## Run the examples below and think about what they do. \n",
"Run the code in the code cell below in the Example area. To run it, **Click in the cell below** and **press \"Ctrl+Enter\"** to run the code. See the message show up below the cell? That is the standard output area for that code cell. Also, see that a number showed up in the \"In [ ]\" brackets to the cell's left? That shows the order in which your cell ran in this Jupyter notebook and that it has completed running. Our \"Hello World!\" program worked because this notebook hosts a python interpreter that can run python code cells. \n",
"\n",
"Try showing \n",
@@ -122,7 +120,6 @@
" Concept\n",
"## Comments\n",
"When coding, programmers include comments for explanation of how code works for reminders and to help others who encounter the code\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/34e2afb1-d07a-44ca-8860-bba1a5476caa/Unit1_Section1.1-Comments.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/34e2afb1-d07a-44ca-8860-bba1a5476caa/Unit1_Section1.1-Comments.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"\n",
"### comments start with the `#` symbol"
]
@@ -181,8 +178,6 @@
"- **Code cells** contain python code and can be interpreted and run from a cell. Code cells display code and output. \n",
" \n",
"- **in edit** or **previously run:** cells can display in editing mode or cells can display results of *code* having been run \n",
- " \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/6b9134fc-c7d7-4d25-b0a7-bdb79d3e1a5b/Unit1_Section1.1-EditRunSave.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/6b9134fc-c7d7-4d25-b0a7-bdb79d3e1a5b/Unit1_Section1.1-EditRunSave.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
" \n",
"### edit mode \n",
"- **text** cells in editing mode show markdown code \n",
@@ -202,7 +197,6 @@
"# \n",
" Concepts\n",
"## Altering Notebook Structure\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/cb195105-eee8-4068-9007-64b2392cd9ff/Unit1_Section1.1-Language_Cells.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/cb195105-eee8-4068-9007-64b2392cd9ff/Unit1_Section1.1-Language_Cells.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### add a cell\n",
"- Highlight any cell and then... add a new cell using **Menu: Insert > Insert Cell Below** or **Insert Cell Above**\n",
"- Add with Keyboard Shortcut: **\"a\"** to insert above or **\"b\"** to insert below\n",
@@ -297,7 +291,6 @@
"# \n",
" Concepts\n",
"## What is a **String?** \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/cbe90d91-876f-42f3-90df-2955588d02b0/Unit1_Section1.2-String.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/cbe90d91-876f-42f3-90df-2955588d02b0/Unit1_Section1.2-String.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"Strings were used in \"Hello World!\" print function examples. Strings are sets of characters. In Python strings are in double or single quotes like `\"Hello World!\"` or `'after edit, save!'` \n",
" \n",
"A String is a common **type** of data, used in programming, consisting of a sequence of 1 or more characters. They are known formally as a primitive data type. \n",
@@ -392,7 +385,6 @@
"# \n",
" Concepts\n",
"## Integers are another type\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/7b0e6a97-551d-4f98-9646-679d30eb2ce4/Unit1_Section1.2-Integers.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/7b0e6a97-551d-4f98-9646-679d30eb2ce4/Unit1_Section1.2-Integers.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"- whole numbers such as `-2, -1, 0, 1, 2, 3` are Integers \n",
"- Integers are **not placed in quotes** \n",
" \n",
@@ -463,7 +455,6 @@
"# \n",
" Concepts\n",
"## Variables & Storing Strings in **Variables** \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/bc5d7c7c-b30f-41d1-acc3-131fa4bc9634/Unit1_Section1.2-Variables.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/bc5d7c7c-b30f-41d1-acc3-131fa4bc9634/Unit1_Section1.2-Variables.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### Variables are named containers\n",
"Computer programs often create storage for things that are used in repeated processing like item_price, student_name, stock_symbol. In python a variable is a type of **object** that can be addressed by name to access the assigned contents.\n",
"\n",
@@ -577,7 +568,6 @@
"# \n",
" Concepts\n",
"## Data types in variables\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/85de7ef1-bdd3-4460-849a-41e976bfdf46/Unit1_Section1.2-Types.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/85de7ef1-bdd3-4460-849a-41e976bfdf46/Unit1_Section1.2-Types.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"variables can be initialized with different data types. Below we see item_price is a **decimal** (aka - float) and student_name is **string** \n",
" \n",
"```python\n",
@@ -764,8 +754,6 @@
"## Using the Python `type()` function\n",
"**`type()`** returns the data type of python objects\n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/b8fbc662-a42e-4a4a-8cfc-564cb240576e/Unit1_Section1.3-Type.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/b8fbc662-a42e-4a4a-8cfc-564cb240576e/Unit1_Section1.3-Type.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
"### `str`, `int`, `float` \n",
"#### What does using `type()` reveal?\n",
"- **`str`**: when **type()** returns **str** that means it has evaluated a **string** characters (numbers, letters, punctuation...) in quotes \n",
@@ -973,8 +961,6 @@
" Concepts\n",
"## Addition: Numbers and Strings \n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/a8befa5f-b4a5-4081-87c0-8846be85c719/Unit1_Section1.4-Addition.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/a8befa5f-b4a5-4081-87c0-8846be85c719/Unit1_Section1.4-Addition.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
"### Numeric addition\n",
"**Numeric addition** Single line *math equations*, run in a code cell, will output a sum \n",
"```python\n",
@@ -1098,9 +1084,7 @@
"# \n",
" Concepts \n",
"## use addition in variable assignments \n",
- "It is common to store the results of addition in a variable \n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/48aefdf7-8f2f-4080-97e9-c25477f71248/Unit1_Section1.4-Assignment.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/48aefdf7-8f2f-4080-97e9-c25477f71248/Unit1_Section1.4-Assignment.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "It is common to store the results of addition in a variable\n",
"\n",
"## use addition in `print ()` \n",
"Use **`print()`** to show the results of multiple lines of output \n",
@@ -1206,9 +1190,7 @@
"# \n",
" Concepts \n",
"## Errors!\n",
- "Encountering **Errors** and troubleshooting errors are fundamental parts of computer programming\n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/7ab2739a-95e6-4399-9b84-19ac5698bbea/Unit1_Section1.4-TypeError.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/7ab2739a-95e6-4399-9b84-19ac5698bbea/Unit1_Section1.4-TypeError.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])"
+ "Encountering **Errors** and troubleshooting errors are fundamental parts of computer programming"
]
},
{
@@ -1322,7 +1304,6 @@
"source": [
" Examples\n",
"## SyntaxError\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/1a1cd6c0-793f-4bcb-a0a0-c9f95a302142/Unit1_Section1.4-SyntaxNameErrors.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/1a1cd6c0-793f-4bcb-a0a0-c9f95a302142/Unit1_Section1.4-SyntaxNameErrors.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"- Improperly formatted string (quotes don't match) that results in a SyntaxError"
]
},
@@ -1508,7 +1489,6 @@
"# \n",
" Activity\n",
"## print() character art\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/d7a3d1b4-8d8d-4e9e-a984-a6920bcd7ca1/Unit1_Section1.5-ASCII_Art.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/d7a3d1b4-8d8d-4e9e-a984-a6920bcd7ca1/Unit1_Section1.5-ASCII_Art.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"print() output to the console can create character art in the forms of pictures and stylized text. Below we show how to create a stylized letter \"A\" "
]
},
@@ -1606,9 +1586,7 @@
"\n",
"## input() \n",
"### get information from users with `input()` \n",
- "the **`input()`** function prompts the user to supply data returning that data as a string\n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/7a8881cb-0bdd-493c-b1a1-9849a95d05e6/Unit1_Section2-1-input-basic.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/7a8881cb-0bdd-493c-b1a1-9849a95d05e6/Unit1_Section2-1-input-basic.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n"
+ "the **`input()`** function prompts the user to supply data returning that data as a string"
]
},
{
@@ -1695,9 +1673,7 @@
"### user prompts using `input()`\n",
"\n",
"the **`input()`** function has an optional string argument which displays the string intended to inform a user what to enter \n",
- "**`input()`** works similar to **`print()`** in the way it displays arguments as output \n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c607aa57-b18b-4f29-a317-7b13db66d8e8/Unit1_Section2-1-input-prompt.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c607aa57-b18b-4f29-a317-7b13db66d8e8/Unit1_Section2-1-input-prompt.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n"
+ "**`input()`** works similar to **`print()`** in the way it displays arguments as output\n"
]
},
{
@@ -1819,8 +1795,6 @@
" Concepts\n",
"## Addition: Numbers and Strings \n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/a8befa5f-b4a5-4081-87c0-8846be85c719/Unit1_Section1.4-Addition.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/a8befa5f-b4a5-4081-87c0-8846be85c719/Unit1_Section1.4-Addition.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
"### Numeric addition\n",
"**Numeric addition** Single line *math equations*, run in a code cell, will output a sum \n",
"```python\n",
@@ -1967,9 +1941,6 @@
" \n",
"**`print()`** provides using **commas** to combine stings for output \n",
"by comma separating strings **`print()`** will output each separated by a space by default\n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/ac97f001-e639-494e-aa15-e420efb5a7a8/Unit1_Section2-2-Print-Comma_Format.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/ac97f001-e639-494e-aa15-e420efb5a7a8/Unit1_Section2-2-Print-Comma_Format.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
"#### comma formatted `print()`\n",
"- **[ ]** print 3 strings on the same line using commas inside the `print()` function "
]
@@ -2025,7 +1996,6 @@
"# \n",
" Concepts \n",
"## using commas in `print()` with strings and numbers together\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/46b436d7-31ed-4e9a-a4c9-55f9eaacfb84/Unit1_Section2-2-Print-String_Number.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/46b436d7-31ed-4e9a-a4c9-55f9eaacfb84/Unit1_Section2-2-Print-String_Number.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"- **`print()`** function formatting with comma separation works different than with string addition.\n",
"- **`print()`** using comma separation can mix numbers (int & float) and strings without a TypeError\n",
"\n",
@@ -2233,8 +2203,6 @@
"**`print()`** provides using **commas** to combine stings for output \n",
"by comma separating strings **`print()`** will output each separated by a space by default\n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/ac97f001-e639-494e-aa15-e420efb5a7a8/Unit1_Section2-2-Print-Comma_Format.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/ac97f001-e639-494e-aa15-e420efb5a7a8/Unit1_Section2-2-Print-Comma_Format.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
"#### comma formatted `print()`\n",
"- **[ ]** print 3 strings on the same line using commas inside the `print()` function "
]
@@ -2290,7 +2258,6 @@
"# \n",
" Concepts \n",
"## using commas in `print()` with strings and numbers together\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/46b436d7-31ed-4e9a-a4c9-55f9eaacfb84/Unit1_Section2-2-Print-String_Number.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/46b436d7-31ed-4e9a-a4c9-55f9eaacfb84/Unit1_Section2-2-Print-String_Number.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"- **`print()`** function formatting with comma separation works different than with string addition.\n",
"- **`print()`** using comma separation can mix numbers (int & float) and strings without a TypeError\n",
"\n",
@@ -2483,7 +2450,6 @@
"# \n",
" Concepts \n",
"## quotes inside strings \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c21bfb29-21f6-4bef-b00e-25d2f7440153/Unit1_Section2-3-Quotes_in_Strings.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c21bfb29-21f6-4bef-b00e-25d2f7440153/Unit1_Section2-3-Quotes_in_Strings.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### single quotes in double quotes\n",
"to display single quotes **`'`** in a string - double quotes can be used as the outer quotes: **`\"it's time\"`**\n",
"### double quotes in single quotes\n",
@@ -2560,7 +2526,6 @@
"# \n",
" Concepts \n",
"## Boolean string tests\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"https://jupyternootbookwams.streaming.mediaservices.windows.net/dfe6e85f-8022-471c-8d92-0b1d61ebffbd/Unit1_Section2-3-Boolean_String_Methods.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"https://jupyternootbookwams.streaming.mediaservices.windows.net/dfe6e85f-8022-471c-8d92-0b1d61ebffbd/Unit1_Section2-3-Boolean_String_Methods.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"methods\n",
"- .isalpha()\n",
"- .isalnum()\n",
@@ -2718,7 +2683,6 @@
"# \n",
" Concepts \n",
"## quotes inside strings \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c21bfb29-21f6-4bef-b00e-25d2f7440153/Unit1_Section2-3-Quotes_in_Strings.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c21bfb29-21f6-4bef-b00e-25d2f7440153/Unit1_Section2-3-Quotes_in_Strings.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### single quotes in double quotes\n",
"to display single quotes **`'`** in a string - double quotes can be used as the outer quotes: **`\"it's time\"`**\n",
"### double quotes in single quotes\n",
@@ -2794,8 +2758,8 @@
"source": [
"# \n",
" Concepts \n",
- "## Boolean string tests\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"https://jupyternootbookwams.streaming.mediaservices.windows.net/dfe6e85f-8022-471c-8d92-0b1d61ebffbd/Unit1_Section2-3-Boolean_String_Methods.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"https://jupyternootbookwams.streaming.mediaservices.windows.net/dfe6e85f-8022-471c-8d92-0b1d61ebffbd/Unit1_Section2-3-Boolean_String_Methods.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "## Boolean string tests... a bit more detail\n",
+ "\n",
"methods\n",
"- .isalpha()\n",
"- .isalnum()\n",
@@ -2965,7 +2929,6 @@
"# \n",
" Concepts \n",
"## String formatting methods\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/693e416c-ab73-4387-a0d2-5a47668ae4de/Unit1_Section2-4-String-Format_Methods.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/693e416c-ab73-4387-a0d2-5a47668ae4de/Unit1_Section2-4-String-Format_Methods.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"the following methods are applied to string objects\n",
"- **.capitalize()** - capitalizes the first character of a string\n",
"- **.lower()** - all characters of a string are made lowercase\n",
@@ -3055,7 +3018,6 @@
"# \n",
" Concepts\n",
"## Formatting string input()\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/460107d8-5d62-432e-924b-a3c779b2e5c5/Unit1_Section2-4-Input-String_Formatting.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/460107d8-5d62-432e-924b-a3c779b2e5c5/Unit1_Section2-4-Input-String_Formatting.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"When storing input, sometimes a specific format is needed and formatting is applied to the **`input()`** function\n",
"> **Note:** this technique overwrites the original user input in the variable with the formatted value "
]
@@ -3111,7 +3073,6 @@
"# \n",
" Concepts \n",
"## Boolean `in` keyword \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/ef7e8587-8ce6-48a4-9a2f-fb0a09db287f/Unit1_Section2-4-Boolean-in.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/ef7e8587-8ce6-48a4-9a2f-fb0a09db287f/Unit1_Section2-4-Boolean-in.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"the **`in`** keyword can be used as a simple search returning **`True`** or **`False`** indication if a string is included in a target sequence. \n",
"### comparing strings is case sensitive\n",
"`'Hello'` is not the same as `'hello'` "
@@ -3281,7 +3242,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "[Terms of use](http://go.microsoft.com/fwlink/?LinkID=206977) [Privacy & cookies](https://go.microsoft.com/fwlink/?LinkId=521839) © 2017 Microsoft adapted with Permission by Dominic Thomas"
+ "© 2017 Microsoft adapted with Permission by Dominic Thomas"
]
}
],
diff --git a/Python Absolute Beginner/Module_2.0_Tutorials_Functions.ipynb b/Python Absolute Beginner/Module_2.0_Tutorials_Functions.ipynb
index 547527c..9a48c57 100644
--- a/Python Absolute Beginner/Module_2.0_Tutorials_Functions.ipynb
+++ b/Python Absolute Beginner/Module_2.0_Tutorials_Functions.ipynb
@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "# Module 2: Functions\n",
+ "# Absolute Beginner Module 2: Functions (P1M2)\n",
"## Functions Arguments & Parameters\n",
"- **Creating a simple Function with a parameter**\n",
"- Exploring Functions with `return` values \n",
@@ -30,7 +30,7 @@
"## Calling Functions with Arguments: print() is a function built in to Python!\n",
"Functions are used for code tasks that are intended to be reused. For example, you have already used the print() function and passed it **arguments** by putting strings and variables into its parentheses. \n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/621d10f8-23d5-4571-b0fd-aa12b0de98d8/Unit1_Section3.1-function-arguments.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/621d10f8-23d5-4571-b0fd-aa12b0de98d8/Unit1_Section3.1-function-arguments.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "[![view video](https://openclipart.org/download/219326/1432343177.svg)](https://youtu.be/4mE3mL6oQX0)\n",
"\n",
"Python allows us to create **User Defined Functions** and provides many **Built-in Functions** such as **`print()`** \n",
"- **`print()`** can be called using arguments (or without) and sends text to standard output, such as the console. \n",
@@ -49,34 +49,18 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hello World! I am sending string arguments to print \n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"print('Hello World!', 'I am sending string arguments to print ')"
]
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hiroto Yamaguchi will be in the class for 17 year old students.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"student_age = 17\n",
"student_name = \"Hiroto Yamaguchi\"\n",
@@ -85,20 +69,9 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "line 1\n",
- "line 2\n",
- "\n",
- "line 4\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"print(\"line 1\")\n",
"print(\"line 2\")\n",
@@ -142,7 +115,6 @@
" Concept\n",
"## Create a simple Function\n",
"Creating user defined functions is at the core of computer programming. Functions enable code reuse and make code easier to develop and maintain.\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/35458114-6211-4d10-85bc-7c4eb7834c52/Unit1_Section3.1-Simplest_Functions.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/35458114-6211-4d10-85bc-7c4eb7834c52/Unit1_Section3.1-Simplest_Functions.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### basics of a user defined function\n",
"- define a function with **`def`** \n",
"- use indentation (4 spaces)\n",
@@ -181,18 +153,9 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hello there!\n",
- "goodbye\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# defines a function named say_hi\n",
"def say_hi(): #defining the function\n",
@@ -203,7 +166,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -214,17 +177,9 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "33\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"three_three()"
]
@@ -250,20 +205,9 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hello there!\n",
- "goodbye\n",
- "\n",
- "33\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Program defines and calls the say_hi & three_three functions\n",
"# [ ] review and run the code\n",
@@ -300,28 +244,11 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "hi!\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
- "#[ ] define (def) a simple function called yell_it() and call the function\n",
- "\n",
- "\n",
- "\n",
- "def yell_it():\n",
- " phrase = \"hi\"\n",
- " print(phrase+\"!\")\n",
- " \n",
- "yell_it()\n",
- " "
+ "#[ ] define (def) a simple function called yell_it() and call the function\n"
]
},
{
@@ -331,7 +258,6 @@
"# \n",
" Concept\n",
"## Functions that have Parameters\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c84008fa-2ec9-4e4b-8b6b-15b9063852a1/Unit1_Section3.1-funct-parameter.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c84008fa-2ec9-4e4b-8b6b-15b9063852a1/Unit1_Section3.1-funct-parameter.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"**`print()`** and **`type()`** are examples of built-in functions that have **Parameters** defined \n",
" \n",
"**`type()`** has a parameter for a **Python Object** and sends back the *type* of the object\n",
@@ -369,17 +295,9 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "IT IS TIME TO SAVE THE NOTEBOOK!\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# yell_this() yells the string Argument provided\n",
"def yell_this(phrase):\n",
@@ -391,18 +309,9 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hi\n",
- "Bye\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# use a default argument\n",
"def say_this(phrase = \"Hi\"): \n",
@@ -427,22 +336,14 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Give me some words to yell: hi\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] define yell_this() \n",
- "def \n",
+ "\n",
"# [ ] get user input in variable words_to_yell\n",
- "words_to_yell = input(\"Give me some words to yell: \")\n",
+ "\n",
"# [ ] call yell_this function with words_to_yell as argument\n",
"\n"
]
@@ -475,8 +376,6 @@
"# \n",
" Concepts\n",
"## Calling a function with a return value \n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/db990568-d940-4ede-a063-7e40ed25c978/Unit1_Section3.2-function-return.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/db990568-d940-4ede-a063-7e40ed25c978/Unit1_Section3.2-function-return.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"- **`type()`** returns an object type\n",
"- **`type()`** can be called with a float the return value can be stored in a variable\n",
"```python\n",
@@ -505,17 +404,9 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "let's go let's go let's go let's go\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Message double returns the string Argument doubled\n",
"def msg_double(phrase):\n",
@@ -529,27 +420,9 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Save Now! Save Now!\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "str"
- ]
- },
- "execution_count": 25,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
"# example of functions with return values used in functions\n",
"def msg_double(phrase):\n",
@@ -596,9 +469,7 @@
"# \n",
" Concepts\n",
"## Functions with multiple parameters\n",
- "Functions can have multiple parameters separated by commas\n",
- "\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/d82c3856-61ff-4fa3-9a20-df8f6ea4dd7a/Unit1_Section3.2-MultiParam_Function.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/d82c3856-61ff-4fa3-9a20-df8f6ea4dd7a/Unit1_Section3.2-MultiParam_Function.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])"
+ "Functions can have multiple parameters separated by commas"
]
},
{
@@ -687,8 +558,6 @@
"\n",
"Processing sequence flows from the top of a page of code to the bottom. This often means that **Function definitions are placed at the beginning of a page of code.**\n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/29ebdee3-33e8-487f-9c73-621219e5e6d2/Unit1_Section3.3-Object_Sequence.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/29ebdee3-33e8-487f-9c73-621219e5e6d2/Unit1_Section3.3-Object_Sequence.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
- "\n",
"In the sample below, the function **`hat_color`** cannot be accessed since it is initialized after it is called at the bottom of the code. \n",
"```python\n",
"have_hat = hat_available('green') \n",
@@ -719,17 +588,9 @@
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "hat available is True\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# review and run code - note: fix error in the following \"tasks\" section\n",
"def hat_available(color):\n",
@@ -755,9 +616,21 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 1,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "ename": "NameError",
+ "evalue": "name 'hat_available' is not defined",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# [ ] fix the sequence of the code to remove the NameError\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mhave_hat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhat_available\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'green'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'hat available is'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhave_hat\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mNameError\u001b[0m: name 'hat_available' is not defined"
+ ]
+ }
+ ],
"source": [
"# [ ] fix the sequence of the code to remove the NameError\n",
"\n",
@@ -795,7 +668,6 @@
" Task 7\n",
"## Program: bird_available\n",
"The program should ask for user to \"input a bird name to check for availability\" and print a statement informing of availability\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/767e4db3-7909-4829-99db-fd6750ea5d54/Unit1_Section3.3-Bird_Available.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/767e4db3-7909-4829-99db-fd6750ea5d54/Unit1_Section3.3-Bird_Available.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### create this program with a Boolean function `bird_available()`\n",
"- has parameter that takes the name of a type of bird\n",
"- for this exercise the variable `bird_types = 'crow robin parrot eagle sandpiper hawk piegon'`\n",
@@ -852,7 +724,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "[Terms of use](http://go.microsoft.com/fwlink/?LinkID=206977) [Privacy & cookies](https://go.microsoft.com/fwlink/?LinkId=521839) © 2017 Microsoft"
+ "© 2017 Microsoft adapted with permission by Dominic Thomas"
]
}
],
diff --git a/Python Absolute Beginner/Module_3.0_Tutorials_Conditionals.ipynb b/Python Absolute Beginner/Module_3.0_Tutorials_Conditionals.ipynb
index 1b8cf70..ac4b9f6 100644
--- a/Python Absolute Beginner/Module_3.0_Tutorials_Conditionals.ipynb
+++ b/Python Absolute Beginner/Module_3.0_Tutorials_Conditionals.ipynb
@@ -29,9 +29,10 @@
"## Conditionals use `True` or `False`\n",
" - **`if`**\n",
" - **`else`**\n",
- " - **`pass`** \n",
+ " - **`pass`** \n",
+ "## Watch the Walkthrough Video for this Notebook by Clicking Below\n",
" \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c53fdb30-b2b0-4183-9686-64b0e5b46dd2/Unit1_Section4.1-Conditionals.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/c53fdb30-b2b0-4183-9686-64b0e5b46dd2/Unit1_Section4.1-Conditonals.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])"
+ "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( https://www.youtube.com/watch?v=ui9VZ9tmgyE)"
]
},
{
@@ -143,7 +144,7 @@
"# \n",
" Concepts\n",
"## Conditionals: Boolean String test methods with `if`\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/caa56256-733a-4172-96f7-9ecfc12d49d0/Unit1_Section4.1-conditionals-bool.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/caa56256-733a-4172-96f7-9ecfc12d49d0/Unit1_Section4.1-conditonals-bool.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "\n",
"```python\n",
"if student_name.isalpha():\n",
"``` \n",
@@ -301,9 +302,7 @@
" - **`>=`**, **`<=`**\n",
" - **`==`**\n",
" - Assign **`=`** vs compare **`==`**\n",
- " - **`!=`** \n",
- " \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/cf192500-3879-4228-bd50-70dd3f38d831/Unit1_Section4.2-comparison-operators.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/cf192500-3879-4228-bd50-70dd3f38d831/Unit1_Section4.2-comparison-operators.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])"
+ " - **`!=`** "
]
},
{
@@ -406,7 +405,7 @@
" Concepts \n",
"\n",
"## Conditionals: comparison operators with `if`\n",
- "[![view video](https://iajupyterprodblobs.blob.core.windows.net/imagecontainer/common/play_video.png)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/15e3b015-e83b-4ab8-8375-b11e52a348ea/Unit1_Section4.2-conditional-if.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/15e3b015-e83b-4ab8-8375-b11e52a348ea/Unit1_Section4.2-conditional-if.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "\n",
"Comparison operators evaluate to Boolean **`True`** and **`False`** to direct the flow of **`if`** conditionals"
]
},
@@ -635,8 +634,7 @@
"source": [
"# \n",
" Concept\n",
- "## Conditionals: String comparisons with `if`\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/d66365b5-03fa-4d0d-a455-5adba8b8fb1b/Unit1_Section4.3-string-compare-if.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/d66365b5-03fa-4d0d-a455-5adba8b8fb1b/Unit1_Section4.3-string-compare-if.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n"
+ "## Conditionals: String comparisons with `if`\n"
]
},
{
@@ -713,7 +711,7 @@
"- answer key string like \"T\" \n",
"\n",
"Return a string: \"correct\" or incorrect\"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/3805cc48-f5c9-4ec8-86ad-1e1db45788e4/Unit1_Section4.3-TF-quiz.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/3805cc48-f5c9-4ec8-86ad-1e1db45788e4/Unit1_Section4.3-TF-quiz.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "\n",
"### Define and use `tf_quiz()` function \n",
"- **`tf_quiz()`** has **2 parameters** which are both string arguments \n",
" - **`question`**: a string containg a T/F question like \"Should save your notebook after edit?(T/F): \" \n",
@@ -768,7 +766,6 @@
" Concepts\n",
"## conditional `elif`\n",
"\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/a2ac5f4b-0400-4a60-91d5-d350c3cc0515/Unit1_Section5.1-elif.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/a2ac5f4b-0400-4a60-91d5-d350c3cc0515/Unit1_Section5.1-elif.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
"### a little review \n",
"- **`if`** means \"**if** a condition exists then do some task.\" **`if`** is usually followed by **`else`** \n",
"- **`else`** means \"**or else** after we have tested **if**, then do an alternative task\" \n",
@@ -873,7 +870,7 @@
" Concepts\n",
"## casting\n",
"Casting is the conversion from one data type to another Such as converting from **`str`** to **`int`**.\n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/4cbf7f96-9ddd-4962-88a8-71081d7d5ef6/Unit1_Section5.1-casting-input.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/4cbf7f96-9ddd-4962-88a8-71081d7d5ef6/Unit1_Section5.1-casting-input.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])\n",
+ "\n",
"### `int()`\n",
"the **`int()`** function can convert stings that represent whole counting numbers into integers and strip decimals to convert float numbers to integers\n",
"- `int(\"1\") = 1` the string representing the integer character `\"1\"`, cast to a number \n",
@@ -921,7 +918,7 @@
"str_num_2 = \"15\"\n",
"int_num_3 = 10\n",
"# [ ] Add the 3 numbers as integers and print the result\n",
- "print(int(str_num_1)+int(str_num_2)+int_num_3)\n"
+ "\n"
]
},
{
@@ -956,10 +953,7 @@
"outputs": [],
"source": [
"# [ ] code and test: adding using int casting\n",
- "str_integer = \"2\"\n",
- "int_number = 10\n",
- "number_total = int(str_integer) + int_number\n",
- "print(number_total)\n"
+ "\n"
]
},
{
@@ -1062,8 +1056,7 @@
"### `+` addition\n",
"### `-` subtraction\n",
"### `*` multiplication\n",
- "### `/` division \n",
- "[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/5bc97f7e-3015-4178-ac20-371a5302def1/Unit1_Section5.2-Math-operators.ism/manifest\",\"type\":\"application/vnd.ms-sstr+xml\"}],[{\"src\":\"http://jupyternootbookwams.streaming.mediaservices.windows.net/5bc97f7e-3015-4178-ac20-371a5302def1/Unit1_Section5.2-Math-operators.vtt\",\"srclang\":\"en\",\"kind\":\"subtitles\",\"label\":\"english\"}])"
+ "### `/` division "
]
},
{
@@ -1271,7 +1264,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "[Terms of use](http://go.microsoft.com/fwlink/?LinkID=206977) [Privacy & cookies](https://go.microsoft.com/fwlink/?LinkId=521839) © 2017 Microsoft"
+ "© 2017 Microsoft adapted with permission by Dominic Thomas"
]
}
],
diff --git a/Python Absolute Beginner/Module_4.0_Tutorials_Nested_Conditionals.ipynb b/Python Absolute Beginner/Module_4.0_Tutorials_Nested_Conditionals.ipynb
index 3fe4082..439b03b 100644
--- a/Python Absolute Beginner/Module_4.0_Tutorials_Nested_Conditionals.ipynb
+++ b/Python Absolute Beginner/Module_4.0_Tutorials_Nested_Conditionals.ipynb
@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "# Module 4\n",
+ "# Absolute Beginner Module 4: Nested Ifs, While Loops (P1M4)\n",
"## Nested Conditionals\n",
"- Nested Conditionals \n",
"- Escape Sequence print formatting \"\\\\\"\n",
@@ -22,6 +22,8 @@
" Concepts\n",
"## nested conditionals\n",
"\n",
+ "[![view video](https://openclipart.org/download/219326/1432343177.svg)](https://youtu.be/BafLWo66zUE)\n",
+ "\n",
"### Making a sandwich\n",
"Taking a sandwich order starts with sandwich choices:\n",
"> **Cheese or Veggie special?** \n",
@@ -40,19 +42,9 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\"c\" for Cheese or \"v\" for Veggie Special: c\n",
- "\"c\" for Cheddar or \"m\" for Manchego: m\n",
- "Here is your Manchego Cheese sandwich\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# simplified example\n",
"# [ ] review the code then run and following the flowchart paths\n",
@@ -127,36 +119,13 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Is it morning? (Answer 'y' or 'n'): n\n",
- "Is it evening? (Answer 'y' or 'n'): g\n",
- "Answer evening only with y/n.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] Say \"Hello\" with nested if\n",
"# [ ] Challenge: handle input other than y/n\n",
- "\n",
- "morning = input(\"Is it morning? (Answer 'y' or 'n'): \")\n",
- "if morning == \"y\":\n",
- " print(\"Good morning.\")\n",
- "elif morning == \"n\":\n",
- " evening = input(\"Is it evening? (Answer 'y' or 'n'): \")\n",
- " if evening == \"y\":\n",
- " print(\"Good evening.\")\n",
- " elif evening == \"n\":\n",
- " print(\"Hello\")\n",
- " else:\n",
- " print(\"Answer evening only with y/n.\")\n",
- "else:\n",
- " print(\"Answer morning only with y/n.\")\n"
+ "\n"
]
},
{
@@ -176,37 +145,11 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Please guess a bird name: f\n",
- "Sorry, your bird was not found. Try again: d\n",
- "Sorry, your bird was not found. Try again. Last try.: g\n",
- "Sorry! No luck today.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
- "# [ ] Create the \"Guess the bird\" program \n",
- "birds = \"parrot, jay, robin\"\n",
- "bird_guess = input(\"Please guess a bird name: \")\n",
- "if bird_guess.lower() in birds:\n",
- " print(\"You found one on the first try!\")\n",
- "else:\n",
- " guess2 = input(\"Sorry, your bird was not found. Try again: \")\n",
- " if guess2.lower() in birds:\n",
- " print(\"You found one on the second try!\")\n",
- " else:\n",
- " guess3 = input(\"Sorry, your bird was not found. Try again. Last try.: \")\n",
- " if guess3.lower() in birds:\n",
- " print(\"Finally! You got one.\")\n",
- " else:\n",
- " print(\"Sorry! No luck today.\")\n",
- "\n"
+ "# [ ] Create the \"Guess the bird\" program \n"
]
},
{
@@ -259,18 +202,9 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hello World!\n",
- "I am formatting print \n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# review and run example using \\n (new line)\n",
"print('Hello World!\\nI am formatting print ')"
@@ -278,18 +212,9 @@
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "STUDENT NAME\t\tAGE\n",
- "Hiroto Yamaguchi \t17\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# review and run code using \\t (tab)\n",
"student_age = 17\n",
@@ -300,19 +225,9 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\"quotes in quotes\"\n",
- "I've said \"save your notebook,\" so let's do it!\n",
- "for a newline use \\n\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# review and run code \n",
"# using \\\" and \\' (escaped quotes)\n",
@@ -334,20 +249,12 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\"\\\\\\WARNING!///\"\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] print \"\\\\\\WARNING!///\"\n",
- "print(\"\\\"\\\\\\\\\\WARNING!///\\\"\")\n",
+ "\n",
"\n"
]
},
@@ -394,54 +301,20 @@
},
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "enter a word that starts with \"pre\": true\n",
- "Please input a valid \"pre\" word.\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] create and test pre_word()\n",
- "\n",
- "def pre_word(test_word):\n",
- " if test_word.startswith(\"pre\"):\n",
- " if test_word.isalpha():\n",
- " return True\n",
- " else:\n",
- " return False\n",
- " else:\n",
- " return False\n",
- "\n",
- "result = pre_word(input(\"enter a word that starts with \\\"pre\\\": \"))\n",
- "if result:\n",
- " print(\"Nice!\")\n",
- "else:\n",
- " print(\"Please input a valid \\\"pre\\\" word.\")"
+ "\n"
]
},
{
"cell_type": "code",
- "execution_count": 33,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "pr\n"
- ]
- }
- ],
- "source": [
- "x = \"pregame\"\n",
- "print(x[0:2])"
- ]
+ "outputs": [],
+ "source": []
},
{
"cell_type": "markdown",
@@ -454,21 +327,12 @@
},
{
"cell_type": "code",
- "execution_count": 35,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Hello\n",
- "World!\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] review, run, fix\n",
- "print(\"Hello\\nWorld!\")\n",
+ "print(\"Hello/nWorld!)\n",
"\n"
]
},
@@ -520,17 +384,9 @@
},
{
"cell_type": "code",
- "execution_count": 38,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "write forever, unless there is a \"break\"\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Review and run code\n",
"# this example never loops because the break has no conditions\n",
@@ -541,28 +397,9 @@
},
{
"cell_type": "code",
- "execution_count": 39,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "guess the number 1 to 5: 3\n",
- "3 is incorrect\n",
- "\n",
- "guess the number 1 to 5: 2\n",
- "2 is incorrect\n",
- "\n",
- "guess the number 1 to 5: 4\n",
- "4 is incorrect\n",
- "\n",
- "guess the number 1 to 5: 5\n",
- "Yes 5 is correct!\n",
- "\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] review the NUMBER GUESS code then run - Q. what cause the break statement to run?\n",
"number_guess = \"0\"\n",
@@ -621,27 +458,12 @@
},
{
"cell_type": "code",
- "execution_count": 40,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Please input a familiar name friends/family use: Jim\n",
- "Hi Jim\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] create Get Name program\n",
- "familiar_name = \"\"\n",
- "\n",
- "while True:\n",
- " familiar_name = input(\"Please input a familiar name friends/family use: \")\n",
- " if familiar_name != \"\":\n",
- " break\n",
- "print(\"Hi\",familiar_name)\n"
+ "\n"
]
},
{
@@ -671,19 +493,9 @@
},
{
"cell_type": "code",
- "execution_count": 41,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "3\n",
- "4\n",
- "6\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] review and run example\n",
"votes = 3\n",
@@ -698,18 +510,9 @@
},
{
"cell_type": "code",
- "execution_count": 44,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "4\n",
- "3\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"print(votes)\n",
"\n",
@@ -719,21 +522,9 @@
},
{
"cell_type": "code",
- "execution_count": 45,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "seat count: 0\n",
- "seat count: 1\n",
- "seat count: 2\n",
- "seat count: 3\n",
- "seat count: 4\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] review the SEAT COUNT code then run \n",
"\n",
@@ -748,23 +539,9 @@
},
{
"cell_type": "code",
- "execution_count": 46,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "enter seat type of \"hard\",\"soft\" or \"exit\" (to finish): hard\n",
- "enter seat type of \"hard\",\"soft\" or \"exit\" (to finish): hard\n",
- "enter seat type of \"hard\",\"soft\" or \"exit\" (to finish): hard\n",
- "enter seat type of \"hard\",\"soft\" or \"exit\" (to finish): soft\n",
- "\n",
- "seats are full\n",
- "4 Seats Total: 3 hard and 1 soft\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] review the SEAT TYPE COUNT code then run entering: hard, soft, medium and exit\n",
"\n",
@@ -887,25 +664,9 @@
},
{
"cell_type": "code",
- "execution_count": 49,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "8 !\n",
- "7 !\n",
- "6 !\n",
- "5 !\n",
- "4 !\n",
- "3 !\n",
- "2 !\n",
- "\n",
- "IGNITION!\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# review and run GREET COUNT\n",
"greet_count = 8\n",
@@ -938,32 +699,12 @@
},
{
"cell_type": "code",
- "execution_count": 51,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Give me a name of an animal or type \"exit\": dog\n",
- "Give me a name of an animal or type \"exit\": crow\n",
- "Give me a name of an animal or type \"exit\": exit\n",
- " dog crow exit\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] Create the Animal Names program, run tests\n",
- "num_animals = 0\n",
- "all_animals = \"\"\n",
- "\n",
- "while num_animals < 4:\n",
- " all_animals += \" \"+ input(\"Give me a name of an animal or type \\\"exit\\\": \")\n",
- " num_animals += 1\n",
- " if \"exit\" in all_animals:\n",
- " break\n",
- " \n",
- "print (all_animals)\n"
+ "\n"
]
},
{
@@ -990,23 +731,9 @@
},
{
"cell_type": "code",
- "execution_count": 57,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "ename": "KeyboardInterrupt",
- "evalue": "Interrupted by user",
- "output_type": "error",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
- "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mstudent_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\".\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mstudent_fname\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misalpha\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mstudent_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"enter student\\'s first (Letters only, No spaces): \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"\\n\"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mstudent_fname\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtitle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"has been entered as first name\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;32m~/opt/anaconda3/lib/python3.8/site-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 858\u001b[0m \u001b[0;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 859\u001b[0m )\n\u001b[0;32m--> 860\u001b[0;31m return self._input_request(str(prompt),\n\u001b[0m\u001b[1;32m 861\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 862\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;32m~/opt/anaconda3/lib/python3.8/site-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 902\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 903\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 904\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Interrupted by user\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 905\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 906\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Invalid Message:\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mKeyboardInterrupt\u001b[0m: Interrupted by user"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# review and run example that loops until a valid first name format is entered\n",
"student_fname = \".\"\n",
@@ -1039,7 +766,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -1059,121 +786,15 @@
},
{
"cell_type": "code",
- "execution_count": 59,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "1 x 1 = 1\n",
- "2 x 2 = 4\n",
- "3 x 3 = 9\n",
- "4 x 4 = 16\n",
- "5 x 5 = 25\n",
- "6 x 6 = 36\n",
- "7 x 7 = 49\n",
- "8 x 8 = 64\n",
- "9 x 9 = 81\n",
- "10 x 10 = 100\n",
- "11 x 11 = 121\n",
- "12 x 12 = 144\n",
- "13 x 13 = 169\n",
- "14 x 14 = 196\n",
- "15 x 15 = 225\n",
- "16 x 16 = 256\n",
- "17 x 17 = 289\n",
- "18 x 18 = 324\n",
- "19 x 19 = 361\n",
- "20 x 20 = 400\n",
- "21 x 21 = 441\n",
- "22 x 22 = 484\n",
- "23 x 23 = 529\n",
- "24 x 24 = 576\n",
- "25 x 25 = 625\n",
- "26 x 26 = 676\n",
- "27 x 27 = 729\n",
- "28 x 28 = 784\n",
- "29 x 29 = 841\n",
- "30 x 30 = 900\n",
- "31 x 31 = 961\n",
- "32 x 32 = 1024\n",
- "33 x 33 = 1089\n",
- "34 x 34 = 1156\n",
- "35 x 35 = 1225\n",
- "36 x 36 = 1296\n",
- "37 x 37 = 1369\n",
- "38 x 38 = 1444\n",
- "39 x 39 = 1521\n",
- "40 x 40 = 1600\n",
- "41 x 41 = 1681\n",
- "42 x 42 = 1764\n",
- "43 x 43 = 1849\n",
- "44 x 44 = 1936\n",
- "45 x 45 = 2025\n",
- "46 x 46 = 2116\n",
- "47 x 47 = 2209\n",
- "48 x 48 = 2304\n",
- "49 x 49 = 2401\n",
- "50 x 50 = 2500\n",
- "51 x 51 = 2601\n",
- "52 x 52 = 2704\n",
- "53 x 53 = 2809\n",
- "54 x 54 = 2916\n",
- "55 x 55 = 3025\n",
- "56 x 56 = 3136\n",
- "57 x 57 = 3249\n",
- "58 x 58 = 3364\n",
- "59 x 59 = 3481\n",
- "60 x 60 = 3600\n",
- "61 x 61 = 3721\n",
- "62 x 62 = 3844\n",
- "63 x 63 = 3969\n",
- "64 x 64 = 4096\n",
- "65 x 65 = 4225\n",
- "66 x 66 = 4356\n",
- "67 x 67 = 4489\n",
- "68 x 68 = 4624\n",
- "69 x 69 = 4761\n",
- "70 x 70 = 4900\n",
- "71 x 71 = 5041\n",
- "72 x 72 = 5184\n",
- "73 x 73 = 5329\n",
- "74 x 74 = 5476\n",
- "75 x 75 = 5625\n",
- "76 x 76 = 5776\n",
- "77 x 77 = 5929\n",
- "78 x 78 = 6084\n",
- "79 x 79 = 6241\n",
- "80 x 80 = 6400\n",
- "81 x 81 = 6561\n",
- "82 x 82 = 6724\n",
- "83 x 83 = 6889\n",
- "84 x 84 = 7056\n",
- "85 x 85 = 7225\n",
- "86 x 86 = 7396\n",
- "87 x 87 = 7569\n",
- "88 x 88 = 7744\n",
- "89 x 89 = 7921\n",
- "90 x 90 = 8100\n",
- "91 x 91 = 8281\n",
- "92 x 92 = 8464\n",
- "93 x 93 = 8649\n",
- "94 x 94 = 8836\n",
- "95 x 95 = 9025\n",
- "96 x 96 = 9216\n",
- "97 x 97 = 9409\n",
- "98 x 98 = 9604\n",
- "99 x 99 = 9801\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# [ ] review the code, run, fix the Logic error\n",
"count = 1\n",
"\n",
"# loop 5 times\n",
- "while count < 100:\n",
+ "while count > 5:\n",
" print(count, \"x\", count, \"=\", count*count)\n",
" count +=1\n",
" \n"
@@ -1183,7 +804,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "(c) 2022 Dominic Thomas"
+ "(c) 2017 Microsoft adapted with permission by Dominic Thomas"
]
}
],