Skip to content

Commit a0aac9f

Browse files
committed
2 parents 6793df7 + 49152e6 commit a0aac9f

File tree

4 files changed

+2431
-2291
lines changed

4 files changed

+2431
-2291
lines changed

‎Lecture-0-Scientific-Computing-with-Python.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
"cell_type": "markdown",
313313
"metadata": {},
314314
"source": [
315-
"[IPython notebook](http://ipython.org/notebook.html) is an HTML-based notebook environment for Python, similar to Mathematica or Maple. It is based the IPython shell, but provides a cell-based environment with great interactivity, where calculations can be organized documented in a structured way.\n",
315+
"[IPython notebook](http://ipython.org/notebook.html) is an HTML-based notebook environment for Python, similar to Mathematica or Maple. It is based on the IPython shell, but provides a cell-based environment with great interactivity, where calculations can be organized documented in a structured way.\n",
316316
"\n",
317317
"<!-- <img src=\"files/images/ipython-notebook-screenshot.jpg\" width=\"800\"> -->\n",
318318
"<img src=\"https://raw.github.com/jrjohansson/scientific-python-lectures/master/images/ipython-notebook-screenshot.jpg\" width=\"800\">\n",
@@ -574,4 +574,4 @@
574574
"metadata": {}
575575
}
576576
]
577-
}
577+
}

‎Lecture-1-Introduction-to-Python-Programming.ipynb‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,16 +2338,17 @@
23382338
"# Bad indentation!\n",
23392339
"if statement1:\n",
23402340
" if statement2:\n",
2341-
" print(\"both statement1 and statement2 are True\") # this line is not properly indented"
2341+
" print(\"both statement1 and statement2 are True\") # this line is not properly indented"
23422342
],
23432343
"language": "python",
23442344
"metadata": {},
23452345
"outputs": [
23462346
{
2347-
"output_type": "stream",
2348-
"stream": "stdout",
2349-
"text": [
2350-
"both statement1 and statement2 are True\n"
2347+
"ename": "IndentationError",
2348+
"evalue": "expected an indented block (<ipython-input-88-78979cdecf37>, line 4)",
2349+
"output_type": "pyerr",
2350+
"traceback": [
2351+
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-88-78979cdecf37>\"\u001b[1;36m, line \u001b[1;32m4\u001b[0m\n\u001b[1;33m print(\"both statement1 and statement2 are True\") # this line is not properly indented\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m expected an indented block\n"
23512352
]
23522353
}
23532354
],
@@ -2653,7 +2654,7 @@
26532654
"source": [
26542655
"## Functions\n",
26552656
"\n",
2656-
"A function in Python is defined using the keyword `def`, followed by a function name, a signature within parenthises `()`, and a colon `:`. The following code, with one additional level of indentation, is the function body."
2657+
"A function in Python is defined using the keyword `def`, followed by a function name, a signature within parentheses `()`, and a colon `:`. The following code, with one additional level of indentation, is the function body."
26572658
]
26582659
},
26592660
{
@@ -3017,7 +3018,7 @@
30173018
"cell_type": "markdown",
30183019
"metadata": {},
30193020
"source": [
3020-
"This technique is useful for exmample when we want to pass a simple function as an argument to another function, like this:"
3021+
"This technique is useful for example when we want to pass a simple function as an argument to another function, like this:"
30213022
]
30223023
},
30233024
{
@@ -3072,15 +3073,15 @@
30723073
"\n",
30733074
"In Python a class can contain *attributes* (variables) and *methods* (functions).\n",
30743075
"\n",
3075-
"In python a class is defined almost like a function, but using the `class` keyword, and the class definition usually contains a number of class method definitions (a function in a class).\n",
3076+
"A class is defined almost like a function, but using the `class` keyword, and the class definition usually contains a number of class method definitions (a function in a class).\n",
30763077
"\n",
3077-
"* Each class method should have an argurment `self` as it first argument. This object is a self-reference.\n",
3078+
"* Each class method should have an argument `self` as it first argument. This object is a self-reference.\n",
30783079
"\n",
30793080
"* Some class method names have special meaning, for example:\n",
30803081
"\n",
3081-
" * `__init__`: The name of the method that is invoked when the object is first created.\n",
3082-
" * `__str__` : A method that is invoked when a simple string representation of the class is needed, as for example when printed.\n",
3083-
" * There are many more, see http://docs.python.org/2/reference/datamodel.html#special-method-names"
3082+
" * `__init__`: The name of the method that is invoked when the object is first created.\n",
3083+
" * `__str__` : A method that is invoked when a simple string representation of the class is needed, as for example when printed.\n",
3084+
" * There are many more, see http://docs.python.org/2/reference/datamodel.html#special-method-names"
30843085
]
30853086
},
30863087
{
@@ -3127,7 +3128,7 @@
31273128
"input": [
31283129
"p1 = Point(0, 0) # this will invoke the __init__ method in the Point class\n",
31293130
"\n",
3130-
"print(p1) # this will invode the __str__ method"
3131+
"print(p1) # this will invoke the __str__ method"
31313132
],
31323133
"language": "python",
31333134
"metadata": {},
@@ -3419,7 +3420,7 @@
34193420
"source": [
34203421
"## Exceptions\n",
34213422
"\n",
3422-
"In Python errors are managed with a special language construct called \"Exceptions\". When errors occur exceptions can be raised, which interrupts the normal program flow and fallback to somewhere else in the code where the closest try-except statements is defined.\n"
3423+
"In Python errors are managed with a special language construct called \"Exceptions\". When errors occur exceptions can be raised, which interrupts the normal program flow and fallback to somewhere else in the code where the closest try-except statement is defined.\n"
34233424
]
34243425
},
34253426
{

0 commit comments

Comments
 (0)