Skip to content

Commit

Permalink
add part 2 notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevdp committed Sep 5, 2013
1 parent 313b52c commit a928b92
Show file tree
Hide file tree
Showing 3 changed files with 709 additions and 153 deletions.
2 changes: 1 addition & 1 deletion notebooks/00_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
},
"source": [
"## Why should a Scientist use Python?\n",
"## Some of the alternatives:\n",
"## A look at the alternatives:\n",
"\n",
"<h2 style=\"text-align:left; color:green;\">C, C++, Fortran</h3>\n",
"\n",
Expand Down
60 changes: 35 additions & 25 deletions notebooks/01_basic_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<style>\n",
" div.cell, div.text_cell_render{\n",
" max-width:750px;\n",
" margin-left:auto;\n",
" margin-right:auto;\n",
" }\n",
"\n",
" h1, h2 {\n",
" text-align:center;\n",
" font-familly:\"Charis SIL\", serif;\n",
" }\n",
"</style>"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -21,11 +39,11 @@
"source": [
"# Outline\n",
"\n",
"- ## Python is easy! Hello world\n",
"- ## Calculator / basic math\n",
"- ## Strings\n",
"- ## Variables\n",
"- ## Basic control statements (indentation!)"
"- ### Python is easy! Hello world revisited\n",
"- ### Calculator / basic math\n",
"- ### Strings\n",
"- ### Variables\n",
"- ### Basic control statements (indentation!)"
]
},
{
Expand All @@ -34,7 +52,7 @@
"source": [
"# Hello World!\n",
"\n",
"## in Python:"
"We saw before how easy a hello world script is to create in Python:"
]
},
{
Expand Down Expand Up @@ -1650,7 +1668,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### More on Variables & Types ###"
"## More on Variables & Types"
]
},
{
Expand Down Expand Up @@ -1827,7 +1845,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Strings ###"
"## Strings"
]
},
{
Expand Down Expand Up @@ -2634,7 +2652,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Flow control: conditionals and loops"
"## Flow control: conditionals and loops"
]
},
{
Expand Down Expand Up @@ -2817,7 +2835,7 @@
"source": [
"ordering matters. The first block of `True` in an if/elif gets executed then everything else does not.\n",
"\n",
"#### blocks cannot be empty ####"
"### Blocks cannot be empty!"
]
},
{
Expand Down Expand Up @@ -2951,28 +2969,20 @@
"\n",
"Create a program (a .py file) which repeatedly asks the user for a word.\n",
"The program should append all the words together. When the user types\n",
"a \"!\" or a \".\", the program should print the resulting sentence and exit.\n",
"a \"!\", \"?\", or a \".\", the program should print the resulting sentence and exit.\n",
"\n",
"For example, a session might look like this:\n",
"\n",
" [~]$ python breakout01.py\n",
" Enter a word: My\n",
" Enter a word: name\n",
" Enter a word: is\n",
" Enter a word: Walter\n",
" Enter a word: White\n",
" Enter a word: !\n",
" Enter a word (. ! or ? to end): My\n",
" Enter a word (. ! or ? to end): name\n",
" Enter a word (. ! or ? to end): is\n",
" Enter a word (. ! or ? to end): Walter\n",
" Enter a word (. ! or ? to end): White\n",
" Enter a word (. ! or ? to end): !\n",
" \n",
" My name is Walter White!"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
Expand Down
Loading

0 comments on commit a928b92

Please sign in to comment.