Skip to content

Commit

Permalink
Major update; complete restructure.
Browse files Browse the repository at this point in the history
  • Loading branch information
geozeke committed May 4, 2020
1 parent 23e19ba commit 7c37991
Show file tree
Hide file tree
Showing 27 changed files with 2,313 additions and 75 deletions.
83 changes: 81 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
# notebooks
# Introduction to Python using Jupyter Notebooks

This is a collaboration repo for developing Jupyter Notebooks for teaching Python programming with an emphasis on the fundamentals of Cyber Operations.
This is a collection of Jupyter Notebooks for teaching Python programming with an emphasis on the fundamentals of Cyber Operations. It's not meant to be a complete Python textbook, but rather an organized reference guide to allow you to see interactive examples on specific Python topics.

## Topics

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


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


2. Functions and Objects
* Common Functions
* Object and Methods
* Formatting output (`.format()`)


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


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


5. Functions
* Introduction
* Defining Functions
* Calling Functions
* Arguments and Parameters
* Pass by Reference
* Variable Scope
* Returning Multiple Values


6. Lists, Dictionaries, Sets, Tuples
* Creating
* Accessing Data


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


8. Crypto
* Hashing Strings


9. Exception Handling
* Catching exceptions
* Raising exceptions


10. Recursion
* Introduction
* Examples


11. OOP
* User-defined Classes


12. Misc Topics
File renamed without changes.
165 changes: 165 additions & 0 deletions content/00_intro00.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Welcome to Jupyter Notebooks!\n",
"\n",
"Jupyter Notebooks are powerful interactive documents that allow you to run code blocks directly inside them."
]
},
{
"cell_type": "markdown",
"metadata": {},
"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",
"* 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."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<br clear=\"all\" />\n",
"<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",
"<hr>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Code Examples\n",
"Here are some examples of executable Python3 code blocks that you'll see in Jupyter Notebooks."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To run the code below, click (once) on the code block and press `Cntl-Enter`.\n",
"\n",
"This code example is interactive and will ask you for input.\n",
"\n",
"To re-run the code, press `Cntl-Enter` again.\n",
"\n",
"To clear the output, right-click on the cell and select `Clear Outputs`"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(\"This is a Python Program\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here's another example that demonstrates simple addition. Try running it."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(10 + 25)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, here's a simple \"Magic 8-Ball\" game. Credit for idea to: [Python for Beginners](https://www.pythonforbeginners.com/code-snippets-source-code/magic-8-ball-written-in-python/)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Closing jupyter lab\n",
"\n",
"When you're done using jupyter lab, the easiest way to exit is to select \"Shutdown\" from the File menu in the browser. You can then close the browser window where it's running (saving any changes to your notebooks if desired).\n",
"\n",
"<br clear=\"all\" />\n",
"<img src=\"../images/00shutdown.png\" align=\"left\" />\n",
"<br clear=\"all\" />"
]
},
{
"cell_type": "markdown",
"metadata": {},
"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",
"\n",
"*NOTE: Jupyter Lab is the next evolution of the Jupyter infrastructure. The basic program (jupyter notebook) started it all.*\n",
"\n",
"[Getting Started With Jupyter Notebook for Python](https://medium.com/codingthesmartway-com-blog/getting-started-with-jupyter-notebook-for-python-4e7082bd5d46)\n",
"\n",
"[Jupyter Notebook for Beginners: A Tutorial](https://www.dataquest.io/blog/jupyter-notebook-tutorial/)\n",
"\n",
"[Jupyter Notebook Tutorial: Introduction, Setup, and Walkthrough](https://www.youtube.com/watch?v=HW29067qVWk) *YouTube Video*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<hr>\n",
"\n",
"*MIT License*\n",
"\n",
"*Copyright 2019-2020 Peter Nardi*\n",
"\n",
"*Terms of use:*\n",
"\n",
"*Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:*\n",
"\n",
"*The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.*\n",
"\n",
"*THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 7c37991

Please sign in to comment.