diff --git a/00-Outlook.ipynb b/00-Outlook.ipynb
index 9eb755c9470f2b7096b69a41327dcfb11b52ddd1..172bb0bdf6d661c6a0aa4549b3e3e5dcec81d68a 100644
--- a/00-Outlook.ipynb
+++ b/00-Outlook.ipynb
@@ -153,7 +153,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.5"
+   "version": "3.6.6"
   }
  },
  "nbformat": 4,
diff --git a/01-Introduction-Environment-Interpreter.ipynb b/01-Introduction-Environment-Interpreter.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..54ec9646794a05149b738534c5a30c042ec8efd0
--- /dev/null
+++ b/01-Introduction-Environment-Interpreter.ipynb
@@ -0,0 +1,1245 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Outlook\n",
+    "\n",
+    "* Philosophy \n",
+    "* Environment\n",
+    "* Interpreter\n",
+    "* Built-in types and operations \n",
+    "* Program file\n",
+    "* Built-in containers\n",
+    "  * Tuples\n",
+    "  * Lists\n",
+    "  * Sets\n",
+    "  * Dicts"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Outlook\n",
+    "\n",
+    "* Flow control contructs\n",
+    "  * if-elif-else\n",
+    "  * For loops\n",
+    "  * While loops\n",
+    "  * Comparison and logical operators\n",
+    "    * Object reference\n",
+    "* File I/O\n",
+    "* Functions\n",
+    "  * Argument Passing\n",
+    "  * Doc string\n",
+    "  * Lambda functions"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Outlook\n",
+    "\n",
+    "* Introspection\n",
+    "* Functional programming\n",
+    "  * sort\n",
+    "  * lambda functions\n",
+    "  * filter, map\n",
+    "* String formatting\n",
+    "  * Old and new style\n",
+    "* Modules\n",
+    "  * Packages\n",
+    "  * Program arguments"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Outlook\n",
+    "\n",
+    "* Standard Library\n",
+    "  * re\n",
+    "  * datetime\n",
+    "  * math, random\n",
+    "  * os.path, glob\n",
+    "  * sqlite3, csv, json\n",
+    "  * sys, os, time\n",
+    "  * argparse\n",
+    "  * logging\n",
+    "  * subprocess"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Outlook\n",
+    "\n",
+    "* Scientific Modules (very quick introduction)\n",
+    "  * Numpy\n",
+    "  * Matplotlib\n",
+    "  * Scipy\n",
+    "  * Pandas"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Outlook (extra)\n",
+    "\n",
+    "* Classes \n",
+    "  * Instances \n",
+    "  * Methods\n",
+    "  * Attributes\n",
+    "  * Inheritance\n",
+    "* Iterables and Iterators\n",
+    "* Error handling"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# introduction"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## philosophy\n",
+    "\n",
+    "Python is a programming language with many good features:\n",
+    "\n",
+    "* Very easy to use\n",
+    "* Easy to learn (looks like pseudo-coding)\n",
+    "* Excellent readability (there is only one way to do anything)\n",
+    "* Excellent portability\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## philosophy\n",
+    "\n",
+    "Do not call it a “scripting language”! Although it can be used as such, it is much more.\n",
+    "\n",
+    "It is an high level language, modern, complete, with which it is possible to realize highly complex software.\n",
+    "\n",
+    "It is an interpreted language, but it would be more appropriate to call it \"dynamic language\"."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## philosophy\n",
+    "\n",
+    "A dynamic language is a high­level language in which many of the controls are executed run-time, while in other languages they are done at compile time.\n",
+    "\n",
+    "Actually python \"compile\" the source into bytecode that runs on a virtual machine (like Java).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## philosophy\n",
+    "\n",
+    "It is a multiparadigm language:\n",
+    "* Imperative\n",
+    "* Object-oriented\n",
+    "* Functional\n",
+    "* Structural\n",
+    "* Aspect-oriented\n",
+    "* Design by contract (with an extension)\n",
+    "* ...\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## The Zen of python"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The Zen of Python, by Tim Peters\n",
+      "\n",
+      "Beautiful is better than ugly.\n",
+      "Explicit is better than implicit.\n",
+      "Simple is better than complex.\n",
+      "Complex is better than complicated.\n",
+      "Flat is better than nested.\n",
+      "Sparse is better than dense.\n",
+      "Readability counts.\n",
+      "Special cases aren't special enough to break the rules.\n",
+      "Although practicality beats purity.\n",
+      "Errors should never pass silently.\n",
+      "Unless explicitly silenced.\n",
+      "In the face of ambiguity, refuse the temptation to guess.\n",
+      "There should be one-- and preferably only one --obvious way to do it.\n",
+      "Although that way may not be obvious at first unless you're Dutch.\n",
+      "Now is better than never.\n",
+      "Although never is often better than *right* now.\n",
+      "If the implementation is hard to explain, it's a bad idea.\n",
+      "If the implementation is easy to explain, it may be a good idea.\n",
+      "Namespaces are one honking great idea -- let's do more of those!\n"
+     ]
+    }
+   ],
+   "source": [
+    "import this"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## disavtanges?\n",
+    "\n",
+    "Python is often considered a slow language. To a large extent this is true: it is slower than Java, for \n",
+    "example.\n",
+    "\n",
+    "But the speed is not always the bottleneck. Often, the management of the complexity is a problem more important than speed.\n",
+    "\n",
+    "However, there are several ways to make faster the \"critical\" parts of a python program.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## performance \n",
+    "\n",
+    "“People are able to code complex algorithms in much less time by using a high-level language like \n",
+    "Python (e.g., also C++). There can be a performance penalty in the most pure sense of the \n",
+    "term.”\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## optimization\n",
+    "\n",
+    "\"The best performance improvement is the transition from the nonworking to the working state.\"\n",
+    "--John Ousterhout\n",
+    "\n",
+    "\"Premature optimization is the root of all evil.\"\n",
+    "--Donald Knuth\n",
+    "\n",
+    "\"You can always optimize it later.\"\n",
+    "-- Unknown\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2 / python3\n",
+    "\n",
+    "There are two main branches of development of python:\n",
+    "* python2: it is a “dead” branch, that is maintained, but that will not undergo updates / evolution\n",
+    "* python3: it is the new python, actually still little used compared to python2.\n",
+    "\n",
+    "The differences are not huge, also there is the utility 2to3 to convert code from the old to the new python.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python3\n",
+    "\n",
+    "* We will take care mainly of python3.\n",
+    "* I will try to point out the main differences.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# environment"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## environment\n",
+    "\n",
+    "With the installation of the Python interpreter it comes also the so called standard library.\n",
+    "\n",
+    "In order to use it you need to import the modules using the keyword **import**."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3.141592653589793\n"
+     ]
+    }
+   ],
+   "source": [
+    "import math\n",
+    "print(math.pi)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## virtualenv\n",
+    "\n",
+    "Virtualenv is a tool to create isolated Python environments.\n",
+    "\n",
+    "It allow a user to install python modules in its privare area without need **root** permissions.\n",
+    "\n",
+    "Virtualenv has one basic command:\n",
+    "\n",
+    "```\n",
+    "$ virtualenv ENV\n",
+    "```\n",
+    "Where ```ENV``` is a directory to place the new virtual environment."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## virtualenv\n",
+    "\n",
+    "A virtual environment needs to be activated before using it:\n",
+    "\n",
+    "```\n",
+    "$ source ENV/bin/activate\n",
+    "```\n",
+    "\n",
+    "on Windows: \n",
+    "\n",
+    "```\n",
+    "> env\\Scripts\\activate\n",
+    "```\n",
+    "\n",
+    "Simply type ```deactivate``` to exit from the virtual environment."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## virtualenv\n",
+    "\n",
+    "At the prompt will be added a prefix to emphasize that the environment is active.\n",
+    "```\n",
+    "(ENV) $\n",
+    "```\n",
+    "An interesting option allow you to choose the interpreter executable to use to create the virtual environment.\n",
+    "\n",
+    "```\n",
+    "$ virtualenv --python=python2.7 ENV\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pip\n",
+    "\n",
+    "`pip` is the Python Packaging Authority ([PyPA](https://www.pypa.io)) recommended tool for installing Python packages form the Python Packege Index ([PyPI](https://pypi.org/)).\n",
+    "```\n",
+    "(ENV) $ pip search peppercorn\n",
+    "peppercorn (0.5)      - A library for converting a token stream into a data structure for use in web form posts\n",
+    "pepperedform (0.6.1)  - Helpers for using peppercorn with formprocess.\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pip\n",
+    "\n",
+    "`pip` take care of installing dependencies before their dependents, i.e. in \"topological order\".\n",
+    "\n",
+    "```\n",
+    "(ENV) $ pip install peppercorn\n",
+    "```\n",
+    "\n",
+    "or, if you prefer not the latest version\n",
+    "\n",
+    "```\n",
+    "(ENV) $ pip install peppercorn==0.4\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pip\n",
+    "\n",
+    "It is possible to use pip to install packages downloaded by the user.\n",
+    "\n",
+    "```\n",
+    "(ENV) $ wget https://some_url/SomeProject.zip\n",
+    "(ENV) $ unzip SomeProject.zip\n",
+    "(ENV) $ pip install -e SomeProject\n",
+    "```\n",
+    "\n",
+    "The option `-e` allow to install local projects in \"editable\" mode."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (virtualenv)\n",
+    "\n",
+    "- Create a virtual environment\n",
+    "- Activate it\n",
+    "- Install the latest version of jupyter on it"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# interpreter"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## interpreter\n",
+    "\n",
+    "- Python is an interpreted language\n",
+    "- The interpreter performs a compilation from source to bytecode, which is then executed on a virtual machine, as in Java\n",
+    "- The interpreter is also an excellent \"calculator\", to be used in interactive!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "2**1024"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## interactive mode\n",
+    "\n",
+    "To launch the interpreter in interactive mode:\n",
+    "\n",
+    "- from a terminal or a command prompt simply type `python`\n",
+    "- launch the idle program"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## interactive mode\n",
+    "\n",
+    "* When used in interactive mode, the interpreter acts a little differently.\n",
+    "* This is the prompt: “>>>” \n",
+    "* If an expression has a value, it is printed automatically:\n",
+    "\n",
+    "<pre>\n",
+    ">>> 34 + 55 - 2\n",
+    "87\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## interactive mode\n",
+    "\n",
+    "* Any error can occur during the execution of the interpreter in interactive mode, the interpreter survives, even in case of SyntaxError:\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "scrolled": false,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "ZeroDivisionError",
+     "evalue": "division by zero",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mZeroDivisionError\u001b[0m                         Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-3-67a69f72677d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;36m5\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
+     ]
+    }
+   ],
+   "source": [
+    "5/0"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## interactive mode"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "NameError",
+     "evalue": "name 'fact' 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<ipython-input-4-dd06d576a896>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mfact\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m100\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mNameError\u001b[0m: name 'fact' is not defined"
+     ]
+    }
+   ],
+   "source": [
+    "fact(100)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "SyntaxError",
+     "evalue": "invalid syntax (<ipython-input-5-0dc3d51d84fc>, line 1)",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-5-0dc3d51d84fc>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m    @@@ausfd?=\u001b[0m\n\u001b[0m     ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
+     ]
+    }
+   ],
+   "source": [
+    "@@@ausfd?="
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## print() \n",
+    "\n",
+    "To print on standard output you may use the print() function.\n",
+    "\n",
+    "It can take any number of arguments:\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0 2 4\n",
+      "6\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(0, 2, 4)\n",
+    "print(6)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0 2 46\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(0, 2, 4, end='')\n",
+    "print(6)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "\n",
+    "Please note, in python2 print is an operator:\n",
+    "\n",
+    "<pre>\n",
+    ">>> print 1, 2, 3\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ipython interpreter\n",
+    "\n",
+    "Born in 2001 as a work of a student (Fernando Perez).\n",
+    "\n",
+    "Based on features he liked in Mathematica and trying to create a system for everyday scientific computing.\n",
+    "\n",
+    "* Command history, which can be browsed with the up and down arrows on the keyboard.\n",
+    "* Tab auto-completion.\n",
+    "* In-line editing of code.\n",
+    "* Object introspection, and automatic extract of documentation strings from python objects like classes and functions.\n",
+    "* Good interaction with operating system shell.\n",
+    "* Support for multiple parallel back-end processes, that can run on computing clusters or cloud services like Amazon EE2."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ipython notebook\n",
+    "\n",
+    "[IPython notebook](http://ipython.org/notebook.html) is an HTML-based notebook environment for Python\n",
+    "\n",
+    "* Based on the IPython shell\n",
+    "* Provides a web cell-based interactive environment powered with Javascript\n",
+    "* System profiles to access unix-terminal-like capability\n",
+    "* Comments and notes with HTML and markdown formats\n",
+    "* Integrates embedded plots"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## jupyter project\n",
+    "\n",
+    "In 2014, Fernado Perez announced a spin-off project from IPython called Project Jupyter (**JU**lia **PYT**hon and **R**). \n",
+    "\n",
+    "IPython will continue to exist as a Python shell and a kernel for Jupyter, while **the notebook** and *other language-agnostic parts of IPython* will move under the Jupyter name. \n",
+    "\n",
+    "Jupyter added support for Julia, R, Haskell and Ruby.\n",
+    "\n",
+    "source: https://en.wikipedia.org/wiki/IPython#Project_Jupyter"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## jupyter notebook\n",
+    "\n",
+    "Jupyter notebooks are based on **jupyter kernels**.\n",
+    "\n",
+    "- A ‘kernel’ is a program that runs and introspects the user’s code. \n",
+    "\n",
+    "A notebook is crazy simple and fun:\n",
+    "\n",
+    "- markdown and notes (consider to [learn markdown language](http://markdowntutorial.com/))\n",
+    "- download ipynb, python, html\n",
+    "- install a library and use\n",
+    "- slideshow it"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## jupyter notebook\n",
+    "\n",
+    "You can start it from a terminal by running `jupyter notebook`\n",
+    "\n",
+    "First, we need to explain how to run cells. Try to run the cell below!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "print(\"Hi! This is a cell. Press the â–¶ button above to run it\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "You can also run a cell with Ctrl+Enter, Shift+Enter or Alt+Enter. Experiment a bit with that."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## jupyter notebook\n",
+    "\n",
+    "One of the most useful things about IPython notebook is its tab completion. \n",
+    "\n",
+    "Try this: click just after read_csv( in the cell below and press Shift+Tab 4 times, slowly"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import pandas as pd"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "pd.read_csv()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "Okay, let's try tab completion for function names!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "pd.r"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## magic functions\n",
+    "\n",
+    "IPython has all kinds of magic functions. Here's an example of comparing sum() with a list comprehension to a generator comprehension using the %time magic."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "60 ms ± 1.59 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%timeit sum([x for x in range(1000000)])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "2.34 ms ± 116 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "import numpy as np\n",
+    "%timeit np.arange(1000000).sum()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "For a list of magic functions type **%quickref**"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## launch a python program\n",
+    "\n",
+    "Form a terminal or command prompt you can simply type `python` and the name of a file containing python code\n",
+    "\n",
+    "```\n",
+    "$ python codes/hello.py    (for Linux and MacOS)\n",
+    "\n",
+    "> python codes\\hello.py    (for Wondows)\n",
+    "\n",
+    "```\n",
+    "\n",
+    "From a jupyter notebook use the **%run** magic"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello World!\n"
+     ]
+    }
+   ],
+   "source": [
+    "%run codes/hello.py"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# python program file"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python program file\n",
+    "\n",
+    "\n",
+    "<pre>\n",
+    "#!/usr/bin/env python3\n",
+    "\n",
+    "# this is a useless comment\n",
+    "a = 10  # this is an inline comment\n",
+    "print(a)\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python program file\n",
+    "\n",
+    "Let us analyze the content:\n",
+    "* The first line\n",
+    "  ```\n",
+    "  #!/usr/bin/env python3\n",
+    "  ```\n",
+    "  It is nothing more than a comment but instructs the Unix shell that will be used the interpreter python3 to run the    program. The trick /usr/bin/env is to avoid worrying about the exact path of the python installation, indeed the env command is able to find it.\n",
+    "\n",
+    "* It must be the first line of the file.\n",
+    "* The file name is arbitrary (not necessarily have to end in .py).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python program file\n",
+    "Let us analyze the content:\n",
+    "* The line\n",
+    "   ```\n",
+    "   # this is a useless comment\n",
+    "   ```\n",
+    "  is a comment, and it is ignored. \n",
+    "* Also the next line contains an inline comment. All that is after a # until the end of the line is not interpreted.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## source encoding\n",
+    "* The python code can be written in any system of characters. By default, if you do not declare anything, it is utf-8.\n",
+    "* But it can be anything, even Chinese."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "* In python2 the default encoding is latin1, and it is nothing but ASCII characters. Accented letters, for example, are not allowed, not even in the comments.\n",
+    "* To change the encoding is used a line like this at the beginning of the file:\n",
+    "```\n",
+    "# -*- coding: utf-8 -*-\n",
+    "```\n",
+    "(PEP 0263)\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (name.py)\n",
+    "* Define a string name that contains your name, a string surname containing your last name;\n",
+    "* Print the length of the two strings;\n",
+    "* Concatenate the two strings forming name_surname;\n",
+    "* Print the length of name_surname.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/01-Introduction_to_Python.ipynb b/01-Introduction_to_Python.ipynb
index 201fb193c69750d4cf3e75c48183dacc4151f4f3..e6d76c1480f02cb9d5c81c63eec882d3e53231d7 100644
--- a/01-Introduction_to_Python.ipynb
+++ b/01-Introduction_to_Python.ipynb
@@ -6727,7 +6727,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.5"
+   "version": "3.6.6"
   },
   "widgets": {
    "state": {},
diff --git a/02-Built-in_types_and_operations.ipynb b/02-Built-in_types_and_operations.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..4fa4eded44d6508ed288e384d178648c679098a1
--- /dev/null
+++ b/02-Built-in_types_and_operations.ipynb
@@ -0,0 +1,1509 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# built-in types and operations"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## integers\n",
+    "\n",
+    "* In python the integers have arbitrary precision; This allowed us to calculate `2**1024` without problems.\n",
+    "* Any integer whose definition can be contained in the RAM of your computer is permitted.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "\n",
+    "In python2 there are two types of integers: \n",
+    "* int for integers up to `2**63-1` (see sys.maxint)\n",
+    "* long for integers of any size!\n",
+    "The int values are automatically converted into long as \n",
+    "needed:\n",
+    "\n",
+    "<pre>\n",
+    ">>> print a, type(a)\n",
+    "9223372036854775807 &lt;type 'int'&gt;\n",
+    ">>> a += 1\n",
+    ">>> print a, type(a)\n",
+    "9223372036854775808 &lt;type 'long'&gt;\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## floating point \n",
+    "The floating point numbers are represented by the type _**float**_:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "5.562684646268003e-309"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "2.0**-1024"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "float"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "type(2.0)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## floating point\n",
+    "\n",
+    "The floating point numbers have finite precision:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "OverflowError",
+     "evalue": "(34, 'Numerical result out of range')",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mOverflowError\u001b[0m                             Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-10-7897dac30894>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;36m2.0\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m2048\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mOverflowError\u001b[0m: (34, 'Numerical result out of range')"
+     ]
+    }
+   ],
+   "source": [
+    "2.0**+2048"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## integer division\n",
+    "\n",
+    "In python, dividing two integers produces a float:\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2.5"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "10 / 4"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "When you want the division with truncation, you can use the operator //:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 12,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "10 // 4"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "Despite being highly atypical compared to other languages, this is very convenient."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## division with truncation\n",
+    "\n",
+    "The operator // division with truncation is also \n",
+    "available for the float:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2.5"
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "10.0 / 4.0"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2.0"
+      ]
+     },
+     "execution_count": 14,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "10.0 // 4.0"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "\n",
+    "In python2, integer division produces an integer, \n",
+    "and it matches with the division with truncation."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## divmod\n",
+    "\n",
+    "Sometimes it is helpful to have both the quotient and the remainder of a integer division; you can use the divmod() function\n",
+    "\n",
+    "This function returns two values, the quotient and the remainder (or modulo)."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(2, 2)"
+      ]
+     },
+     "execution_count": 15,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "divmod(10,4)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (interactive mode)\n",
+    "\n",
+    "<pre>\n",
+    "Do the following:\n",
+    ">>> 2**1024\n",
+    ">>> 100/3\n",
+    ">>> 100//3\n",
+    ">>> 100.0/3\n",
+    ">>> 100.0//3\n",
+    ">>> 100%3\n",
+    ">>> divmod(100, 3)\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(33, 1)"
+      ]
+     },
+     "execution_count": 16,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "divmod(100,3)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## complex\n",
+    "There is a `complex` type"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(6+0j)"
+      ]
+     },
+     "execution_count": 17,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "z = 3.0 + 4.0j\n",
+    "w = 3.0 - 4.0j\n",
+    "z+w"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(25+0j)"
+      ]
+     },
+     "execution_count": 18,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "z*w"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "complex"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "type(z)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3.0 4.0 5.0\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(z.real, z.imag, abs(z))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## variables\n",
+    "\n",
+    "You can assign to any object a symbolic name, which does not need to be declared."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "a = 5\n",
+    "b = 3.2\n",
+    "c = a\n",
+    "C = b # it's not \"c\", it's another variable"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## variables\n",
+    "\n",
+    "Although it is a bit premature to explain it now, actually __symbolic names a, b, c and C are not \n",
+    "variables.__\n",
+    "\n",
+    "Moreover, the symbol \"=\" is not at all what it seems!\n",
+    "\n",
+    "For now anyway we can continue \"pretending\" that these symbols are variables and that \"=\" execute an assignment or copy (as in C, C++ or Fortran).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## operators\n",
+    "\n",
+    "Common operators are available:\n",
+    "* \\+ (sum, concatenation)\n",
+    "* \\- (subtraction)\n",
+    "* \\* (product)\n",
+    "* / (division)\n",
+    "* // (integer division, this is new)\n",
+    "* % (modulo)\n",
+    "* ...\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## binary operators\n",
+    "\n",
+    "Like in C, binary operators are associated to assignment operators:\n",
+    "* += (increase)\n",
+    "* -= (decrease)\n",
+    "* ...\n",
+    "therefore,"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "14"
+      ]
+     },
+     "execution_count": 22,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = 10\n",
+    "a += 4\n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "* The type str is commonly used for the strings. It can handle unicode strings.\n",
+    "* They can be created either with single quotes ('alpha') or double quotes (“alpha”)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'alphabeta'"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"alpha\" + 'beta'"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "Strings can be printed in 2 ways: \n",
+    "* If function print() is used, the string content is shown\n",
+    "\n",
+    "```python\n",
+    ">>> print(\"Hello, \" + \"world!\")\n",
+    "Hello, world!\n",
+    "```\n",
+    "\n",
+    "* In the interactive intepreter, if we write an expression that produces a string, the content will be shown with quotes:\n",
+    "\n",
+    "```python\n",
+    ">>> \"Hello, \" + \"world!\"\n",
+    "'Hello, world!'\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "* Triple quotes: `“””` or `'''`, can be used for strings that span over more than one line, or that contain single or double quotes (or the other triple quotes):"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "This string spans over two lines,\n",
+      "and contains 'single quotes', \"double quotes\" and \n",
+      "'''triple quotes'''\n"
+     ]
+    }
+   ],
+   "source": [
+    "a = \"\"\"This string spans over two lines,\n",
+    "and contains 'single quotes', \"double quotes\" and \n",
+    "'''triple quotes'''\"\"\"\n",
+    "print(a)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "* Escape characters are more or less like in C code:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "alpha\n",
+      "beta\tgamma\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(\"alpha\\nbeta\\tgamma\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "* It's possible to create raw strings (escape characters will not be interpreted):"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "alfa\\nbeta\\tgamma\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(r\"alfa\\nbeta\\tgamma\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "* This is particular helpful in defining regular expression"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "It is possible to operate on strings in different ways:\n",
+    "\n",
+    "Try yourself on a python interpreter\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "s = \"Hello, world!\""
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'hello, world!'"
+      ]
+     },
+     "execution_count": 26,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.lower()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'HELLO, WORLD!'"
+      ]
+     },
+     "execution_count": 27,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.upper()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'Hello, World!'"
+      ]
+     },
+     "execution_count": 28,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.title()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'Hellx, wxrld!'"
+      ]
+     },
+     "execution_count": 29,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.replace('o', 'x')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "8"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.find('or')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "13"
+      ]
+     },
+     "execution_count": 31,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "len(s)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'HELLO, WORLD!'"
+      ]
+     },
+     "execution_count": 32,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"Hello, world!\".upper()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "We can have access to single characters or substrings:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 33,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "hi_folk = \"Hi, folk!\"\n",
+    "#          012345678 "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 34,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'H'"
+      ]
+     },
+     "execution_count": 34,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hi_folk[0]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 35,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'f'"
+      ]
+     },
+     "execution_count": 35,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hi_folk[4]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 36,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'!'"
+      ]
+     },
+     "execution_count": 36,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hi_folk[-1]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 37,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "hi_folk = \"Hi, folk!\"\n",
+    "#          012345678 "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 38,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "', folk!'"
+      ]
+     },
+     "execution_count": 38,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hi_folk[2:]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 39,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'Hi,'"
+      ]
+     },
+     "execution_count": 39,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hi_folk[:3]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 40,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "', f'"
+      ]
+     },
+     "execution_count": 40,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hi_folk[2:5]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "Interestingly, strings cannot be modified:\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 41,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "TypeError",
+     "evalue": "'str' object does not support item assignment",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-41-4010d49c126f>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mhi_folk\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'X'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m: 'str' object does not support item assignment"
+     ]
+    }
+   ],
+   "source": [
+    "hi_folk[1] = 'X'"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "Often we are faced with the need of splitting strings in tokens:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 42,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['alpha', 'beta', 'gamma']"
+      ]
+     },
+     "execution_count": 42,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s = \"alpha:beta:gamma\"\n",
+    "s.split(\":\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 43,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'alpha:beta:gamma'"
+      ]
+     },
+     "execution_count": 43,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "':'.join(['alpha', 'beta', 'gamma'])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "Some times we need to remove leading or trailing characters:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 44,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'alpha beta\\tgamma'"
+      ]
+     },
+     "execution_count": 44,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s = \" \\t\\n alpha beta\\tgamma \"\n",
+    "s.strip()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 45,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'alpha beta\\tgamma '"
+      ]
+     },
+     "execution_count": 45,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.lstrip()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 46,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "' \\t\\n alpha beta\\tgamma'"
+      ]
+     },
+     "execution_count": 46,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.rstrip()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## strings\n",
+    "\n",
+    "By default str.strip() remove all the characters of space type (' ', '\\t', '\\n'); it can also \n",
+    "receive the characters to remove:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 47,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'bbbccc'"
+      ]
+     },
+     "execution_count": 47,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s = \"aaabbbccc\"\n",
+    "s.strip(\"a\")  # try stripping also \"b\", \"c\", and \"ab\""
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## bool \n",
+    "\n",
+    "The bool type is used for logical values True/False.\n",
+    "\n",
+    "Thus, a bool object can assume either one of: \n",
+    "valori:\n",
+    "* `True`\n",
+    "* `False`\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## None\n",
+    "\n",
+    "In python exists a special object called None. It is used as an indefinite value (or no value). It is not a type, but an object!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "None\n"
+     ]
+    }
+   ],
+   "source": [
+    "a = None\n",
+    "print(a)"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/02-Introduction_to_Python.ipynb b/02-Introduction_to_Python.ipynb
index ea3e7c14e65ffe53caf3162f0e896b7235f9709d..464383bb849f0fd223707a90733609dd1c97a4e9 100644
--- a/02-Introduction_to_Python.ipynb
+++ b/02-Introduction_to_Python.ipynb
@@ -11,45 +11,6 @@
     "![](images/title_intro_python.png)"
    ]
   },
-  {
-   "cell_type": "markdown",
-   "metadata": {
-    "slideshow": {
-     "slide_type": "subslide"
-    }
-   },
-   "source": [
-    "## Outlook\n",
-    "\n",
-    "* File I/O\n",
-    "* Functions\n",
-    "  * Argument Passing\n",
-    "  * Doc string\n",
-    "  * Lambda functions\n",
-    "* Introspection"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {
-    "slideshow": {
-     "slide_type": "subslide"
-    }
-   },
-   "source": [
-    "## Outlook\n",
-    "\n",
-    "* Functional programming\n",
-    "  * sort\n",
-    "  * lambda functions\n",
-    "  * filter, map\n",
-    "* String formatting\n",
-    "  * Old and new style\n",
-    "* Modules\n",
-    "  * Packages\n",
-    "  * Program arguments"
-   ]
-  },
   {
    "cell_type": "markdown",
    "metadata": {
@@ -3913,7 +3874,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.5"
+   "version": "3.6.6"
   }
  },
  "nbformat": 4,
diff --git a/03-Built-in_containers.ipynb b/03-Built-in_containers.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..d17980c1e45564ca5f9bdfc6bf3242ca11542244
--- /dev/null
+++ b/03-Built-in_containers.ipynb
@@ -0,0 +1,2753 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# containers"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## containers\n",
+    "One of the strengths of python is the availability of the containers, which are very efficient, comfortable to use, and versatile:\n",
+    "* tuple ()\n",
+    "* list []\n",
+    "* dict {}\n",
+    "* set {}, frozenset\n",
+    "* other containers in collections module\n",
+    " * OrderedDict, Counter, defaultdict...\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## tuples\n",
+    "A tuple is an __ordered__ sequence, __immutable__, of values, in arbitrary number and arbitrary type."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 48,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(3, 4, 5)"
+      ]
+     },
+     "execution_count": 48,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = (3, 4, 5)\n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 49,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "4"
+      ]
+     },
+     "execution_count": 49,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a[1]  # indexes from 0 to len-1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 50,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(2, 3)"
+      ]
+     },
+     "execution_count": 50,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b = 2,3  # without brackets!\n",
+    "b"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## tuples\n",
+    "\n",
+    "They are not necessarily homogeneous:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 51,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(4, (3+4j), 'alfa', (2, 3))"
+      ]
+     },
+     "execution_count": 51,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "z = (3 + 4j)\n",
+    "c = (4, z, \"alfa\", b)\n",
+    "c"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "They can also be on the left of the equal sign:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 52,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(3+4j)"
+      ]
+     },
+     "execution_count": 52,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "z"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 53,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(3.0, 4.0)"
+      ]
+     },
+     "execution_count": 53,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "r, i = z.real, z.imag\n",
+    "r, i"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 54,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(33, 1)"
+      ]
+     },
+     "execution_count": 54,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d, m = divmod(100, 3)\n",
+    "d, m"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## tuples\n",
+    "\n",
+    "They define other operations"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 55,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "a = (1, 2, 3)\n",
+    "b = (4, 5, 6)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "- Concatenation"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 56,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(1, 2, 3, 4, 5, 6)"
+      ]
+     },
+     "execution_count": 56,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a + b"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "- Reiteration"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 57,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(1, 2, 3, 1, 2, 3, 1, 2, 3)"
+      ]
+     },
+     "execution_count": 57,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a * 3 "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## tuples\n",
+    "\n",
+    "The brackets are not required (almost never); but the comma is important!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 58,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "int"
+      ]
+     },
+     "execution_count": 58,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "x = 1\n",
+    "type(x)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 59,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "tuple"
+      ]
+     },
+     "execution_count": 59,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "y = 1,\n",
+    "type(y)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 60,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(1,)"
+      ]
+     },
+     "execution_count": 60,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "y"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "The brackets are only necessary to define the empty tuple:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 61,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "()"
+      ]
+     },
+     "execution_count": 61,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "empty = ()\n",
+    "empty"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## tuples\n",
+    "\n",
+    "Slicing gives you access to \"portions\" of a tuple:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 62,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(0, 1, 2, 3, 4)"
+      ]
+     },
+     "execution_count": 62,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = (0, 1, 2, 3, 4)\n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 63,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(1, 2)"
+      ]
+     },
+     "execution_count": 63,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a[1:3]  # from the second element INCLUDED to the fourth EXCLUDED"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 64,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(0, 1)"
+      ]
+     },
+     "execution_count": 64,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a[:2]  # from the first INCLUDED to the third EXCLUDED"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 65,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(2, 3, 4)"
+      ]
+     },
+     "execution_count": 65,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a[2:] # from the third INCLUDED to the last EXCLUDED"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 66,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(2, 3, 4, 0, 1)"
+      ]
+     },
+     "execution_count": 66,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a[2:] + a[:2]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## tuples\n",
+    "\n",
+    "Tuples can not be changed, like strings:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 67,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "t = (1, 2, 3)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 68,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "TypeError",
+     "evalue": "'tuple' object does not support item assignment",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-68-29b3302c4f70>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mt\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m: 'tuple' object does not support item assignment"
+     ]
+    }
+   ],
+   "source": [
+    "t[0] = 2"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (name.py)\n",
+    "\n",
+    "* Starting from the file _name.py_, define a tuple containing your name, your last name, and year of birth.\n",
+    "\n",
+    "* Build, starting from the previous one, a new tuple containing, in order, year of birth, name, last name).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## lists\n",
+    "\n",
+    "A list is an __ordered__ sequence, __mutable__ of arbitrary values in arbitrary number.\n",
+    "\n",
+    "In practice they are mutable tuples.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 69,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 3]"
+      ]
+     },
+     "execution_count": 69,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = [1, 2, 3]\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 70,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 3, 4]"
+      ]
+     },
+     "execution_count": 70,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.append(4)\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 71,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 'XYZ', 3, 4]"
+      ]
+     },
+     "execution_count": 71,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.insert(2, \"XYZ\")\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 72,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "5"
+      ]
+     },
+     "execution_count": 72,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "len(l)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists\n",
+    "\n",
+    "As with tuples, you can \"slice\" lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 73,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 'XYZ', 3, 4]"
+      ]
+     },
+     "execution_count": 73,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 74,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "1"
+      ]
+     },
+     "execution_count": 74,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l[0] # not a container"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 75,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "4"
+      ]
+     },
+     "execution_count": 75,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l[-1] # not a container"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 76,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2]"
+      ]
+     },
+     "execution_count": 76,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l[:2]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 77,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[2, 'XYZ', 3, 4]"
+      ]
+     },
+     "execution_count": 77,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l[-4:]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 78,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, (3, 2, 1, 0), 'XYZ', 3, 4]"
+      ]
+     },
+     "execution_count": 78,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l[1] = 3, 2, 1, 0\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists\n",
+    "\n",
+    "Some of the functioncs that operate on lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 79,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[3, 5, 7, 11, 13, 2]"
+      ]
+     },
+     "execution_count": 79,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = [3, 5, 7, 9, 11, 13]\n",
+    "l.append(2)\n",
+    "l.remove(9)\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 80,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[2, 3, 5, 7, 11, 13]"
+      ]
+     },
+     "execution_count": 80,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.sort()\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 81,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[13, 11, 7, 5, 3, 2]"
+      ]
+     },
+     "execution_count": 81,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.reverse()\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists\n",
+    "\n",
+    "Lists can be used as stacks:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 82,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[13, 11, 7, 5, 3, 2]"
+      ]
+     },
+     "execution_count": 82,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 83,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 83,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.pop()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 84,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 84,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.pop()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 85,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[13, 11, 7, 5]"
+      ]
+     },
+     "execution_count": 85,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 86,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[13, 11, 7, 5, 13, 11, 7, 5]"
+      ]
+     },
+     "execution_count": 86,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l *= 2\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "items assignment "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 87,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[13, 'a', 'b', 'c', 13, 11, 7, 5]"
+      ]
+     },
+     "execution_count": 87,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l[1:4] = ['a', 'b', 'c']\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 88,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 88,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.count(13) # try also l.count('z')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 89,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 89,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.index('c')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lists"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 90,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[13, 'a', 'b', 'c', 13, 11, 7, 5, 2, 3, 5]"
+      ]
+     },
+     "execution_count": 90,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.extend( (2,3,5) )\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 91,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[5, 2, 3, 5]"
+      ]
+     },
+     "execution_count": 91,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "del l[:-4]\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (books.py)\n",
+    "\n",
+    "Define a list containing the names of some books that you read.\n",
+    "\n",
+    "Add few more items to the list.\n",
+    "\n",
+    "Print the number of items in the list.Sort the list."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## range\n",
+    "\n",
+    "Range is a function to build sequences of integers:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 92,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "range(0, 4)"
+      ]
+     },
+     "execution_count": 92,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "range(4)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 93,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 1, 2, 3]"
+      ]
+     },
+     "execution_count": 93,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(4))\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 94,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[3, 4, 5, 6]"
+      ]
+     },
+     "execution_count": 94,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(range(3, 7))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 95,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[3, 5, 7, 9]"
+      ]
+     },
+     "execution_count": 95,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(range(3, 10, 2))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## range\n",
+    "\n",
+    "Actually range does not build a list or a tuple, but a sequence, that is an object iterable in a given direction.\n",
+    "\n",
+    "Basically, range returns an object that you can scroll from the first to the last element, one element after another, always in the same direction.\n",
+    "\n",
+    "From this object you can build a container, such as a list or a tuple.\n",
+    "\n",
+    "\n",
+    "\n",
+    "\n",
+    "\n",
+    " \n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "\n",
+    "In python2 the range(...) function has the same interface we've seen, but returns a list.\n",
+    "\n",
+    "Instead the xrange(...) function behaves exactly like the range in python3."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## extended slices\n",
+    "\n",
+    "Slicing syntax also accepts a stride parameter, always separated by \":\""
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 96,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]"
+      ]
+     },
+     "execution_count": 96,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(20))\n",
+    "l[1:18]  \n",
+    "# try also \n",
+    "#l[1:18:3]\n",
+    "#l[1::3]\n",
+    "#l[:5:3]\n",
+    "#l[::3]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## extended slices\n",
+    "\n",
+    "stride can also be negative"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 97,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[18, 15, 12, 9, 6]"
+      ]
+     },
+     "execution_count": 97,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(20))\n",
+    "l[18:3:-3]  \n",
+    "# try also \n",
+    "#l[17:2:-3]\n",
+    "#l[::-1] "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## extended slices\n",
+    "\n",
+    "When you assign with slicing, the extended slices are less flexible than regular slices, in fact the length \n",
+    "of the operands must be identical:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 98,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['a', 0, 1, 2, 3, 'd']"
+      ]
+     },
+     "execution_count": 98,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(5))\n",
+    "r = ['a', 'b', 'c', 'd']\n",
+    "r[1:3] = l[:-1]  # len(r[1:3]) == len(l[:-1]), OK\n",
+    "r"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## extended slices"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 99,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "ValueError",
+     "evalue": "attempt to assign sequence of size 3 to extended slice of size 2",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-99-4d9e2228211e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mr\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m]\u001b[0m  \u001b[0;31m# len(r[::2]) != len(l[::2]), KO!!!\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mValueError\u001b[0m: attempt to assign sequence of size 3 to extended slice of size 2"
+     ]
+    }
+   ],
+   "source": [
+    "r[::3] = l[::2]  # len(r[::2]) != len(l[::2]), KO!!!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 100,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 0, 2, 2, 4, 'd']"
+      ]
+     },
+     "execution_count": 100,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "r[::2] = l[::2] # len(r[::2]) == len(l[::2]), ok\n",
+    "r"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## extended slices\n",
+    "When you delete items with slicing, there are no problems:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 101,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 4, 5, 7, 8, 10]"
+      ]
+     },
+     "execution_count": 101,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(11))\n",
+    "del l[::3]\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 102,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[2, 5, 8]"
+      ]
+     },
+     "execution_count": 102,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "del l[::2]\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## sets\n",
+    "\n",
+    "A set is an __unordered__ collection, without duplicates, __mutable__, containing arbitrary values in arbitrary number.\n",
+    "\n",
+    "A frozenset is an __unordered__ collection, without duplicates, __immutable__, containing arbitrary values in arbitrary number.\n",
+    "\n",
+    "They are not ordered in the sense that the elements are not maintained in a meaningful user order; this because the order used by the interpreter is useful to make fast searching of items.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 103,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{2, 3, 4}"
+      ]
+     },
+     "execution_count": 103,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s = set()\n",
+    "s.add(2)\n",
+    "s.add(3)\n",
+    "s.add(2)\n",
+    "s.add(4)\n",
+    "s"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 104,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'alfa', 2, 3.5}"
+      ]
+     },
+     "execution_count": 104,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "u = set(['alfa', 2, 3.5])\n",
+    "u"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "one can also use the `'{}'`"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 105,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'alfa', 2, 3.5}"
+      ]
+     },
+     "execution_count": 105,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "u = {'alfa', 2, 3.5}\n",
+    "u"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 106,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{1, 2, 3, 4}"
+      ]
+     },
+     "execution_count": 106,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l=[1, 2, 2, 3, 3, 3, 4, 4, 4, 4]\n",
+    "t = set(l)\n",
+    "t"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 107,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{2, 3, 4}"
+      ]
+     },
+     "execution_count": 107,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 108,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{2, 3, 4}"
+      ]
+     },
+     "execution_count": 108,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.intersection(t)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 109,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "set()"
+      ]
+     },
+     "execution_count": 109,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.difference(t)  # result in set() not {}!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 110,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{1}"
+      ]
+     },
+     "execution_count": 110,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "t.difference(s)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 111,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{1}"
+      ]
+     },
+     "execution_count": 111,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.symmetric_difference(t)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 112,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{1, 2, 3, 4}"
+      ]
+     },
+     "execution_count": 112,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.union(t)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sets"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 113,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{2, 4}"
+      ]
+     },
+     "execution_count": 113,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.discard(3)\n",
+    "s"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 114,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "set()"
+      ]
+     },
+     "execution_count": 114,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s.clear()\n",
+    "s"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## frozensets\n",
+    "\n",
+    "By analogy with the tuples, which can be considered \"frozen lists\", there are also frozensets:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 115,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "frozenset({1, 2, 3, 4})"
+      ]
+     },
+     "execution_count": 115,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "ft = frozenset(t)\n",
+    "ft"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 116,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "AttributeError",
+     "evalue": "'frozenset' object has no attribute 'add'",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-116-73c54a880fa9>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mft\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mAttributeError\u001b[0m: 'frozenset' object has no attribute 'add'"
+     ]
+    }
+   ],
+   "source": [
+    "ft.add(2)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (primes_1.py)\n",
+    "\n",
+    "With only these data structures:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 117,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "all = set(range(1, 20))\n",
+    "primes = {1, 2, 3, 5, 7, 11, 13, 17, 19}\n",
+    "even = {2, 4, 6, 8, 10, 12, 14, 16, 18}"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "Print:\n",
+    "* the set of odd numbers\n",
+    "* the set of odd prime numbers\n",
+    "* the set of odd not prime numbers (lower than 20)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## dicts\n",
+    "A dictionary (dict) is a container that associates an arbitrary and __unique key__ to an arbitrary __value__.\n",
+    "\n",
+    "Basically, the keys are handled as a set, but each key is uniquely associated with a value.\n",
+    "\n",
+    "In other languages it is known as an associative array or a map.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dicts"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 118,
+   "metadata": {
+    "scrolled": false,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'C': 6, 'Fe': 26, 'H': 1, 'He': 2}"
+      ]
+     },
+     "execution_count": 118,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "atomic_number = {'H': 1, 'He': 2, 'C': 6, 'Fe': 26}\n",
+    "atomic_number"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 119,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "6"
+      ]
+     },
+     "execution_count": 119,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "atomic_number['C']"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dicts\n",
+    "\n",
+    "They are not necessarily homogeneous:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 120,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'alfa': 3, 2.5: 'xyz', (3+4j): [3, 4, 5], (1, 2, 3): {'x': 2, 'y': 3, 'z': 1}}"
+      ]
+     },
+     "execution_count": 120,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d = {}\n",
+    "d['alfa'] = 3\n",
+    "d[2.5] = 'xyz'\n",
+    "d[3+4j] = [3, 4, 5]\n",
+    "d[(1,2,3)] = { 'x': 2, 'y': 3, 'z': 1 }\n",
+    "d"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dicts"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 121,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['alfa', 2.5, (3+4j), (1, 2, 3)]"
+      ]
+     },
+     "execution_count": 121,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(d.keys())"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 122,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[3, 'xyz', [3, 4, 5], {'x': 2, 'y': 3, 'z': 1}]"
+      ]
+     },
+     "execution_count": 122,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(d.values())"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 123,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[('alfa', 3),\n",
+       " (2.5, 'xyz'),\n",
+       " ((3+4j), [3, 4, 5]),\n",
+       " ((1, 2, 3), {'x': 2, 'y': 3, 'z': 1})]"
+      ]
+     },
+     "execution_count": 123,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(d.items())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dicts"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 124,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 124,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "'alfa' in d  # try also 'beta' in d"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 125,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 125,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d.get('alfa', -1999)  # try also  d.get('beta', -1999)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 126,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'alfa': 3,\n",
+       " 2.5: 'xyz',\n",
+       " (3+4j): [3, 4, 5],\n",
+       " (1, 2, 3): {'x': 2, 'y': 3, 'z': 1},\n",
+       " 'beta': -1999}"
+      ]
+     },
+     "execution_count": 126,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d.setdefault('alfa', -1999)\n",
+    "d.setdefault('beta', -1999)\n",
+    "d"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dicts\n",
+    "\n",
+    "They can be used as stacks:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 127,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 127,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d.pop('alfa', -5)   # -5 is a default value in case the requiret key is not found\n",
+    "                    # try also d.pop('gamma', -5)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 128,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "('beta', -1999)"
+      ]
+     },
+     "execution_count": 128,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d.popitem()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 129,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{2.5: 'xyz', (3+4j): [3, 4, 5], (1, 2, 3): {'x': 2, 'y': 3, 'z': 1}}"
+      ]
+     },
+     "execution_count": 129,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dicts\n",
+    "\n",
+    "updating a dictionary"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 130,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'a': 1, 'b': 2, 'c': 3, 'd': 4, 1: 1.0, 2: 2.0}"
+      ]
+     },
+     "execution_count": 130,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d1 = dict(a=1, b=2, c=3, d=4)\n",
+    "d2 = {1: 1.0, 2: 2.0}\n",
+    "d1.update(d2)\n",
+    "d1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 131,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{}"
+      ]
+     },
+     "execution_count": 131,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d.clear()\n",
+    "d"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (books.py)\n",
+    "\n",
+    "Define a dictionary that links some of the books that you read with the name of its author.\n",
+    "\n",
+    "Print the names of all authors (without duplicates)."
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/03-Introduction_to_Python.ipynb b/03-Introduction_to_Python.ipynb
index c090d08dcf9c88f54ab8f19e3f26dca95469fa40..963e2c3ce9108b29fcc5e95f18741a36c521edac 100644
--- a/03-Introduction_to_Python.ipynb
+++ b/03-Introduction_to_Python.ipynb
@@ -1350,6 +1350,7 @@
    "cell_type": "code",
    "execution_count": 45,
    "metadata": {
+    "scrolled": true,
     "slideshow": {
      "slide_type": "fragment"
     }
@@ -1427,10 +1428,18 @@
     }
    },
    "source": [
-    "## Scientific Modules\n",
-    "<center>\n",
-    "![](images/scientific-python-stack.jpg)\n",
-    "</center>"
+    "## Scientific Modules"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "![](images/scientific-python-stack.jpg)"
    ]
   },
   {
@@ -4452,7 +4461,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.5"
+   "version": "3.6.6"
   }
  },
  "nbformat": 4,
diff --git a/04-Control_flow.ipynb b/04-Control_flow.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..e15b2917e164c6b67e962cee7cee87c662c5fd41
--- /dev/null
+++ b/04-Control_flow.ipynb
@@ -0,0 +1,1426 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# flow control constructs"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## indentation\n",
+    "\n",
+    "Python has few constructs for flow control, according to the philosophy of maximum simplicity.\n",
+    "\n",
+    "* In python indentation is syntactic, that is it determines the nesting of statements.\n",
+    "* This is an integral part of the python philosophy: since indenting is good, and since a program without indentation is bad, why do not force to indent?\n",
+    "* Thus becomes unnecessary to use the curly brackets to enclose blocks, as in C/C++, or statement of closure, as the END of Fortran.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## indentation\n",
+    "\n",
+    "How much you should indent? \n",
+    "\n",
+    "It is arbitrary, but must be consistent within the block.\n",
+    "\n",
+    "Style/common sense rules are:\n",
+    "* indent always with 4 spaces\n",
+    "* NEVER use tabs to indent"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## if-elif-else"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 144,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "a , b = 1 , 2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 145,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "if a == b:\n",
+    "    print(a)\n",
+    "elif a > b:\n",
+    "    print(b)\n",
+    "else:\n",
+    "    print(a + b)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## for loop\n",
+    "\n",
+    "* The for loop allows you to iterate over \"iterable objects\" as lists, tuples, sets, dicts, range, ..."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 146,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(3):\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 147,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a\n",
+      "b\n",
+      "10\n",
+      "5.5\n"
+     ]
+    }
+   ],
+   "source": [
+    "t = ('a', 'b', 10, 5.5)\n",
+    "for i in t:\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 148,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a\n",
+      "b\n",
+      "c\n"
+     ]
+    }
+   ],
+   "source": [
+    "d = {'a': 0, 'b': 1, 'c': 2}\n",
+    "for key in d.keys():\n",
+    "    print(key)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 149,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n"
+     ]
+    }
+   ],
+   "source": [
+    "for val in d.values():\n",
+    "    print(val)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 150,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a = 0\n",
+      "b = 1\n",
+      "c = 2\n"
+     ]
+    }
+   ],
+   "source": [
+    "for key, val in d.items():\n",
+    "    print(key, '=', val)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 151,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a\n",
+      "b\n",
+      "c\n"
+     ]
+    }
+   ],
+   "source": [
+    "for key in d:\n",
+    "    print(key)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 152,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "None\n",
+      "2\n"
+     ]
+    }
+   ],
+   "source": [
+    "for key in ('a', 'd', 'c'):\n",
+    "    print(d.get(key, None))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for loop"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 153,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0, 2, 3, 4, 6, 8, 9}"
+      ]
+     },
+     "execution_count": 153,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "s = set(list(range(0, 10, 2))+list(range(0, 10, 3)))\n",
+    "s"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 154,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "2\n",
+      "3\n",
+      "4\n",
+      "6\n",
+      "8\n",
+      "9\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in s:\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## for & range\n",
+    "The use of for and range allows us to understand the difference between \n",
+    "containers (such as lists, tuples, sets, dicts) and iterables (as range). For \n",
+    "example:\n",
+    "\n",
+    "<pre>\n",
+    ">>> for i in range(1000000000000000000000):\n",
+    "...     if i < 3: \n",
+    "...         print(i)\n",
+    "... \n",
+    "0\n",
+    "1\n",
+    "2\n",
+    "...... # please, be patient! \n",
+    "</pre>\n",
+    "\n",
+    "If it was a list or a tuple I would not have enough memory available to build this object!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## if/for body\n",
+    "The indentation has a side effect: there must be at least one statement. \n",
+    "\n",
+    "Then:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 155,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "SyntaxError",
+     "evalue": "unexpected EOF while parsing (<ipython-input-155-0e5327973a24>, line 2)",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-155-0e5327973a24>\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m    # nothing to do\u001b[0m\n\u001b[0m                   ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m unexpected EOF while parsing\n"
+     ]
+    }
+   ],
+   "source": [
+    "if a > 10:\n",
+    "    # nothing to do"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pass\n",
+    "\n",
+    "In these situations you can use the special statement **pass**, which does nothing:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 156,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "if a > 10:\n",
+    "    pass"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## if/for body, single statement\n",
+    "\n",
+    "If the body of the `if/for` block contains a single statement, this can be written on the same line:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 157,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "if a > 10: pass"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "Nothing changes; better avoid that."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (books.py)\n",
+    "\n",
+    "Starting from the dictionary “book : author”, write the code for printing, for each author, the number of books in the dictionary.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## while\n",
+    "\n",
+    "The while loop is the generic loop with one condition:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 158,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n",
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "i = 0\n",
+    "while i < 4:\n",
+    "    print(i)\n",
+    "    i += 1"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## while\n",
+    "\n",
+    "However, the previous loop is not a good example of programming, because we emulated a for loop:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 159,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n",
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(4):\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## while\n",
+    "\n",
+    "The while loop is appropriate when you have an arbitrary condition and no iteration:\n",
+    "\n",
+    "```python\n",
+    "while error > tolerance:\n",
+    "    result, error = compute(result)\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## break\n",
+    "\n",
+    "Break allows you to exit the loop:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 160,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(10000):\n",
+    "    print(i)\n",
+    "    if i%3 == 2:\n",
+    "        break"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## while and break\n",
+    "\n",
+    "Often it is used while to build seemingly endless loop, from which it actually exits with a break:\n",
+    "\n",
+    "```python\n",
+    "while True:\n",
+    "    result, error = compute(result)\n",
+    "    if error < tolerance:\n",
+    "        break\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## continue\n",
+    "\n",
+    "Continue allows you to go to the next iteration:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 161,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "2\n",
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(4):\n",
+    "    if i == 1:\n",
+    "        continue\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## loops: else clause\n",
+    "The loops (for and while) can have an else clause, which is executed only if the loop completes naturally (for example, if you do not exit the loop with a break):"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 162,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n",
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(10):\n",
+    "    if i > 3: break\n",
+    "    print(i)\n",
+    "else:\n",
+    "    print(\"finished!\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## loops: else clause"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 163,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "finished!\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(2):\n",
+    "    if i > 3: break\n",
+    "    print(i)\n",
+    "else:\n",
+    "    print(\"finished!\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## switch\n",
+    "Ther is no construct like a C `switch` or a Fortran select, just use a series of blocks if-elif-else.\n",
+    "\n",
+    "If you have no idea about what the `switch` or select are, you can safely ignore this slide...\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# comparison and logical operators"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## operators\n",
+    "There are several operators:\n",
+    "* Comparison operators: ==, !=, <, <=, >, >=, is, in\n",
+    "* Logical operators: and, or, not\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## comparisons"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 164,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 164,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "1 > 5"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 165,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 165,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b = 1 <= 5\n",
+    "b"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## in\n",
+    "\n",
+    "The expression `a in obj` returns `True` if the object a is content in the object obj. Not all objects contain something; for example obj may be a list, a tuple, a set or a dictionary:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 166,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 166,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lst = [3, 5, 7]\n",
+    "2 in lst"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## in\n",
+    "If the right operand does not allow the operation you receive an error:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 167,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "TypeError",
+     "evalue": "argument of type 'int' is not iterable",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-167-a0c8fa4b4d67>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;36m10\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m: argument of type 'int' is not iterable"
+     ]
+    }
+   ],
+   "source": [
+    "a in 10"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## is\n",
+    "\n",
+    "The expression `a == b` returns `True` if the value of a is identical to the value of b.\n",
+    "\n",
+    "The expresson `a is b` returns `True` if a and b refer to the same physical object:\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 168,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(True, False)"
+      ]
+     },
+     "execution_count": 168,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l1 = [1, 3, 8]\n",
+    "l2 = [1, 3, 8]\n",
+    "l3 = l1\n",
+    "l1 == l2, l1 is l2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 169,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(True, True)"
+      ]
+     },
+     "execution_count": 169,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l1 == l3, l1 is l3"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 170,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(True, False)"
+      ]
+     },
+     "execution_count": 170,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l2 == l3, l2 is l3"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## object reference\n",
+    "It is time to mention the true meaning of an expression like \n",
+    "\n",
+    "<pre>\n",
+    ">>> a = b\n",
+    "</pre>\n",
+    "\n",
+    "Any object is b, this expression does nothing but define a new symbolic name a for the same object.\n",
+    "\n",
+    "It is similar to a link or an alias; Technically, it is called object reference."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## object reference\n",
+    "\n",
+    "So, when we write\n",
+    "\n",
+    "<pre>\n",
+    ">>> a = b\n",
+    "</pre>\n",
+    "\n",
+    "nothing is copied. It follows that a and b are the same object:\n",
+    "\n",
+    "<pre>\n",
+    ">>> a is b\n",
+    "True\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## logical"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "True and True"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "True and False"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "False and False"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## logical"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "True or True"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "True or False"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "False or False"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## logical"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "not True"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "not False"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## conversion to bool\n",
+    "\n",
+    "The built-in types are automatically converted to bools, for example they can be directly used in conditional expressions. The rules are:\n",
+    "\n",
+    "* An `int` equal to 0 is equivalent to False, otherwise `True`\n",
+    "* A `float` equal to 0.0 is equivalent to False, otherwise `True`\n",
+    "* An empty string \"\" is equivalent to False, otherwise `True`\n",
+    "* An empty container (`[]`, `()`, `set()`, `{}`, ...) is equivalent to False, otherwise `True`\n",
+    "* `None` is equivalent to `False`\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (divisors.py)\n",
+    "\n",
+    "Write a code to print all prime divisors of the number 2009\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/04-Introduction_to_Python.ipynb b/04-Introduction_to_Python.ipynb
index f1f3e55420e0ee85fe6dfe22a64897f8453de56c..2732427e7f2edb9d9eabb7af422982e4a89e999b 100644
--- a/04-Introduction_to_Python.ipynb
+++ b/04-Introduction_to_Python.ipynb
@@ -2223,7 +2223,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.5"
+   "version": "3.6.6"
   }
  },
  "nbformat": 4,
diff --git a/05-Input_output.ipynb b/05-Input_output.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..6b94d620bb5886291c6bbbb0adf5225f3ef3fde8
--- /dev/null
+++ b/05-Input_output.ipynb
@@ -0,0 +1,283 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# input / output"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## file I/O\n",
+    "\n",
+    "Let's see how you write a text file:\n",
+    "\n",
+    "- It is good practice to use the `with` keyword when dealing with file objects. \n",
+    "- The advantage is that the file is properly closed after its suite finishes, even if an exception is raised at some point."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "with open(\"a.txt\", \"w\") as f:\n",
+    "    f.write(\"Hello, \")\n",
+    "    f.write(\"world!\\n\")\n",
+    "    f.write(\"This is Python!\\n\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## file I/O\n",
+    "You can read line by line by iterating on file; warning, the newline `'\\n'` is part of the string read!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello, world!\n",
+      "\n",
+      "This is Python!\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "with open(\"a.txt\", \"r\") as f:\n",
+    "    for line in f:\n",
+    "        print(line)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "Read lines contain the newline, to remove it you can use `str.strip()`"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## file I/O\n",
+    "\n",
+    "You can read a single line at a time with readline():"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello, world!\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "with open(\"a.txt\", \"r\") as f:\n",
+    "    print(f.readline())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## file I/O\n",
+    "Or you can read all lines through readlines():"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "['Hello, world!\\n', 'This is Python!\\n']\n"
+     ]
+    }
+   ],
+   "source": [
+    "with open(\"a.txt\", \"r\") as f:\n",
+    "    print(f.readlines())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## closing the file\n",
+    "\n",
+    "If you use the construct `with` (context manager), you not have to worry about closing the file: it will be automatically closed with block exit. \n",
+    "\n",
+    "Do not use any other way to open files!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "_**DO NOT USE THAT!!!**_\n",
+    "\n",
+    "```python\n",
+    ">>> f = open(\"a.txt\", \"r\")\n",
+    ">>> # some operations on file\n",
+    ">>> f.close()\n",
+    "```\n",
+    "\n",
+    "_**DO NOT USE THAT!!!**_"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Command Line Arguments\n",
+    "\n",
+    "Common utility scripts often need to process command line arguments. These arguments are stored in the `sys` module’s `argv` attribute as a list."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "['codes/command_line_argv.py', 'pippo', 'pluto', 'paperino', '1', '2', '3']\n"
+     ]
+    }
+   ],
+   "source": [
+    "%run codes/command_line_argv.py pippo pluto paperino 1 2 3"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (files.py)\n",
+    "\n",
+    "* Read the list of arguments from the command line, and print (one argument per line) all arguments on a file whose name matches the name of the python program plus the extension '.out' (`files.py.out`, but it must also work renaming the program!).\n",
+    "\n",
+    "* Reread all the arguments from the file and print them.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/06-Functions.ipynb b/06-Functions.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..690e157a7500ea87b2af62ef442a39518f593f91
--- /dev/null
+++ b/06-Functions.ipynb
@@ -0,0 +1,1021 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# functions"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions\n",
+    "\n",
+    "* A function is declared with `def`, followed by the function name and the parameter list; the body of the function is indented.\n",
+    "\n",
+    "* You do not have to declare the type of arguments and of the return value."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def summa(a, b):\n",
+    "    return a + b  # function body"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "7.2"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa(3.2, 4)  # works with int and float, \n",
+    "               # try also summa(3.2, 9.1)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'Hello, world!'"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa(\"Hello, \", \"world!\")  # works with strings "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 3, 4, 5]"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa([1, 2], [3, 4, 5])  # lists"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions\n",
+    "\n",
+    "If the function receives parameters of incorrect type, you will have a run-time error:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "TypeError",
+     "evalue": "unsupported operand type(s) for +: 'int' and 'str'",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-5-415ee3ec4b29>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0msumma\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m6\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'ccc'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;32m<ipython-input-1-f411e876abaf>\u001b[0m in \u001b[0;36msumma\u001b[0;34m(a, b)\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0msumma\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m     \u001b[0;32mreturn\u001b[0m \u001b[0ma\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mb\u001b[0m  \u001b[0;31m# function body\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for +: 'int' and 'str'"
+     ]
+    }
+   ],
+   "source": [
+    "summa(6, 'ccc')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions\n",
+    "\n",
+    "Functions can be recursive:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def factorial(n):\n",
+    "    if n < 2:\n",
+    "        return 1\n",
+    "    else:\n",
+    "        return n * factorial(n - 1)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "1\n",
+      "1\n",
+      "120\n",
+      "3628800\n",
+      "788657867364790503552363213932185062295135977687173263294742533244359449963403342920304284011984623904177212138919638830257642790242637105061926624952829931113462857270763317237396988943922445621451664240254033291864131227428294853277524242407573903240321257405579568660226031904170324062351700858796178922222789623703897374720000000000000000000000000000000000000000000000000\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in (0, 1, 5, 10, 200):\n",
+    "    print(factorial(i))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions\n",
+    "\n",
+    "Any function has a return value. By default, this value is `None`. If you want to give a specific return value, for example 4, just add the statement `return` 4.\n",
+    "\n",
+    "A `return` statement without expression to the right is equivalent to return None.\n",
+    "\n",
+    "If a function ends without having encountered any `return`, implicitly it executes a `return None`."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (divisors.py)\n",
+    "* Write a function that determines all the divisors of an arbitrary integer\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "## test (divisors.py -> primes.py)\n",
+    "* Write a function that checks whether a number is prime (no matters if it is not efficient!)\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## arguments passing\n",
+    "The arguments of a function can be passed by __position__ or by __name__:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def count(lst, val):\n",
+    "    c = 0\n",
+    "    for el in lst:\n",
+    "        if el == val: \n",
+    "            c += 1\n",
+    "    return c"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "count([1,2,1,3,2,4], 2)  # passing args by position"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "count(val=2, lst=[1,2,1,3,2,4])  # passing args by name"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## arguments passing\n",
+    "After passing at least an argument by name, you can not to pass the nexts by position:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "SyntaxError",
+     "evalue": "positional argument follows keyword argument (<ipython-input-11-c888420936d4>, line 1)",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-11-c888420936d4>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m    count(val=2, [1,2,1,3,2,4,1])\u001b[0m\n\u001b[0m                ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m positional argument follows keyword argument\n"
+     ]
+    }
+   ],
+   "source": [
+    "count(val=2, [1,2,1,3,2,4,1])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## default arguments\n",
+    "The arguments of a function can have default values; in this case, in the function call they can be omitted:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# argument \"val\" now has a default value\n",
+    "def count(lst, val=1):\n",
+    "    c = 0\n",
+    "    for el in lst:\n",
+    "        if el == val: \n",
+    "            c += 1\n",
+    "    return c"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    " count([1,2,1,3,2,4,1])   # -> count([1,2,1,3,2,4,1], 1)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## default arguments\n",
+    "If an argument accepts a default value, also all next arguments must have a default value:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "SyntaxError",
+     "evalue": "non-default argument follows default argument (<ipython-input-14-6ad44fe60a1c>, line 1)",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-14-6ad44fe60a1c>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m    def f(a, b=0, c):\u001b[0m\n\u001b[0m         ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m non-default argument follows default argument\n"
+     ]
+    }
+   ],
+   "source": [
+    "def f(a, b=0, c):\n",
+    "    print(a+b)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## arbitrary argument list\n",
+    "A function can have arbitrary positional arguments; these arguments are placed in a tuple:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def f(a, *args):\n",
+    "    print(a)\n",
+    "    print(args)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a\n",
+      "()\n"
+     ]
+    }
+   ],
+   "source": [
+    "f(\"a\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a\n",
+      "(2, 5, 'y')\n"
+     ]
+    }
+   ],
+   "source": [
+    "f(\"a\", 2, 5, 'y')\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## arbitrary argument list\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def summa(a, *args):\n",
+    "    for i in args: \n",
+    "        a += i\n",
+    "    return a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa(10)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## arbitrary argument list\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "111"
+      ]
+     },
+     "execution_count": 21,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa(10, 1, 100)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'abcd'"
+      ]
+     },
+     "execution_count": 22,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa(\"a\", \"bc\", \"d\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 3, 4, 5, 6]"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa([1], [], [2, 3], [4, 5, 6])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## arbitrary keyword arguments\n",
+    "Arbitrary arguments can be passed even by name; in such case, they are maintained in a dictionary:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def g(a, **kwargs):\n",
+    "    print(a)\n",
+    "    print(kwargs)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "5\n",
+      "{'y': 9, 'z': 5, 'x': 1}\n"
+     ]
+    }
+   ],
+   "source": [
+    "g(5, y=9, z=5, x=1)  # kwargs are put on a dictionary"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## keyword-only arguments\n",
+    "\n",
+    "A function can have keyword-only arguments that can not be passed positionally, but must always be passed by name.\n",
+    "\n",
+    "They are positioned between `*args` and `**kwargs`; They can have a default. \n",
+    "\n",
+    "If the function does not need to args, you can leave an `*` (???)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## keyword-only arguments"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def foo(a, *, kwonly):\n",
+    "    pass"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "TypeError",
+     "evalue": "foo() missing 1 required keyword-only argument: 'kwonly'",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-28-2a3bb2b3f42e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mfoo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m  \u001b[0;31m# try also foo(10, 5)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mTypeError\u001b[0m: foo() missing 1 required keyword-only argument: 'kwonly'"
+     ]
+    }
+   ],
+   "source": [
+    "foo(10)  # try also foo(10, 5)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "foo(10, kwonly=5)\n",
+    "foo(kwonly=5, a=10)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "Keyword­only arguments are not supported in python2."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## general form of a function\n",
+    "To summarize, the general form of a function is:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def foo(a, b=0, *args, kwonly0, kwonly1=10, **kwargs):\n",
+    "    print(a, b, args, kwonly0, kwonly1, kwargs)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "2 0 () 999 10 {}\n"
+     ]
+    }
+   ],
+   "source": [
+    "foo(2, kwonly0=999)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "2 3 (4, 5, 6, 7) 999 10 {'x': 10.0, 'y': 20.0, 'z': 30.0}\n"
+     ]
+    }
+   ],
+   "source": [
+    "foo(2, 3, 4, 5, 6, 7, x=10.0, y=20.0, z=30.0, kwonly0=999)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## unpacking argument list\n",
+    "Sometimes it may happen to have, in a list or a tuple, the values of the arguments that we want to pass positionally to a function:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 33,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def f(a, b, c):\n",
+    "    return a*b-c"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 34,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "17\n"
+     ]
+    }
+   ],
+   "source": [
+    "args = [3, 5, -2]\n",
+    "print(f(*args))    ### => f(3, 5, -2)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## unpacking keyword arguments\n",
+    "Sometimes it may happen to have, in a dictionary, the arguments to be passed to a function by name:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 35,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def f(x, y, z):\n",
+    "    return x**2 + y**2 - z"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 36,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "20\n"
+     ]
+    }
+   ],
+   "source": [
+    "kwargs = {'x': 3, 'z': 5, 'y': 4}\n",
+    "print(f(**kwargs))      ### => f(x=3, y=4, z=5)"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/07-Introspection-Functional_programming.ipynb b/07-Introspection-Functional_programming.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..b01939a8386976b29f755840974b4708318f0898
--- /dev/null
+++ b/07-Introspection-Functional_programming.ipynb
@@ -0,0 +1,1401 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# introspection"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## type introspection\n",
+    "\n",
+    "In computing, type introspection is the ability of a program to examine the type or properties of an\n",
+    "object at runtime (wikipedia).\n",
+    "\n",
+    "Introspection can be used for\n",
+    "* learning\n",
+    "* debugging\n",
+    "* write some algorithms"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions returning information about objects\n",
+    "\n",
+    "`type()` and `id()` functions return information about live objects (the type and the unique id respectively)."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "dict"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dct = {'a': 1, 'b': 2}\n",
+    "type(dct)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "139928030552784"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "id(dct)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions returning information about objects\n",
+    "\n",
+    "The `dir()` function shows the attributes and methods of an object/type:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['__class__',\n",
+       " '__contains__',\n",
+       " '__delattr__',\n",
+       " '__delitem__',\n",
+       " '__dir__',\n",
+       " '__doc__',\n",
+       " '__eq__',\n",
+       " '__format__',\n",
+       " '__ge__',\n",
+       " '__getattribute__',\n",
+       " '__getitem__',\n",
+       " '__gt__',\n",
+       " '__hash__',\n",
+       " '__init__',\n",
+       " '__init_subclass__',\n",
+       " '__iter__',\n",
+       " '__le__',\n",
+       " '__len__',\n",
+       " '__lt__',\n",
+       " '__ne__',\n",
+       " '__new__',\n",
+       " '__reduce__',\n",
+       " '__reduce_ex__',\n",
+       " '__repr__',\n",
+       " '__setattr__',\n",
+       " '__setitem__',\n",
+       " '__sizeof__',\n",
+       " '__str__',\n",
+       " '__subclasshook__',\n",
+       " 'clear',\n",
+       " 'copy',\n",
+       " 'fromkeys',\n",
+       " 'get',\n",
+       " 'items',\n",
+       " 'keys',\n",
+       " 'pop',\n",
+       " 'popitem',\n",
+       " 'setdefault',\n",
+       " 'update',\n",
+       " 'values']"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dir(dct)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## doc string\n",
+    "You can attach a `doc string` to a function. A `doc string` is an arbitrary string of documentation for the function. The string becomes part of the function; if the name of the function is __foo__, `foo.__doc__` is its `doc string`.\n",
+    "\n",
+    "The `doc string` is a python string placed directly after the `def` line.\n",
+    "\n",
+    "By default, the `doc string` value is `None`."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## doc string"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 37,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def summa(a, b, *args):\n",
+    "    \"\"\"Returns the sum of two or more numbers:\n",
+    "    >>> print(summa(2, 4, 10, 20, 30))\n",
+    "    66\n",
+    "    >>>\"\"\"\n",
+    "    result = a + b\n",
+    "    for i in args:\n",
+    "        result += i\n",
+    "    return result"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 38,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Returns the sum of two or more numbers:\n",
+      "    >>> print(summa(2, 4, 10, 20, 30))\n",
+      "    66\n",
+      "    >>>\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(summa.__doc__)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## doc string\n",
+    "Built-in functions have a doc string, that can help us understand how to use them through the interpreter in interactive:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 39,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "range(stop) -> range object\n",
+      "range(start, stop[, step]) -> range object\n",
+      "\n",
+      "Return an object that produces a sequence of integers from start (inclusive)\n",
+      "to stop (exclusive) by step.  range(i, j) produces i, i+1, i+2, ..., j-1.\n",
+      "start defaults to 0, and stop is omitted!  range(4) produces 0, 1, 2, 3.\n",
+      "These are exactly the valid indices for a list of 4 elements.\n",
+      "When step is given, it specifies the increment (or decrement).\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(range.__doc__) "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## pydoc\n",
+    "Pydoc is a tool, obviously written in python, which uses introspection to provide the information stored in a module in a clear and compact solution.\n",
+    "\n",
+    "Pydoc uses the doc strings `__doc__` and many other standard attributes of the objects (`__name__`, `__file__`, ...).\n",
+    "\n",
+    "Since we are using python3, probably you have to use pydoc3.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pydoc\n",
+    "\n",
+    "<pre style=\"font-size:70%;\">\n",
+    "$ pydoc3 math\n",
+    "Help on built-in module math:\n",
+    "\n",
+    "NAME\n",
+    "  math\n",
+    "\n",
+    "DESCRIPTION\n",
+    "  This module is always available. It provides access to the\n",
+    "  mathematical functions defined by the C standard.\n",
+    "\n",
+    "FUNCTIONS\n",
+    "  acos(...)\n",
+    "    acos(x)\n",
+    " \n",
+    "    Return the arc cosine (measured in radians) of x. \n",
+    "\n",
+    "...\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## help()\n",
+    "In interactive mode, the `help` function does the same thing pydoc does.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## doctest\n",
+    "\n",
+    "The doctest module uses introspection to check if examples contained in docstrings are correct:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "**********************************************************************\r\n",
+      "File \"codes/summa_wrongdoc.py\", line 3, in summa_wrongdoc.summa\r\n",
+      "Failed example:\r\n",
+      "    print(summa(2, 4, 10, 20, 30))\r\n",
+      "Expected:\r\n",
+      "    55\r\n",
+      "Got:\r\n",
+      "    66\r\n",
+      "**********************************************************************\r\n",
+      "1 items had failures:\r\n",
+      "   1 of   1 in summa_wrongdoc.summa\r\n",
+      "***Test Failed*** 1 failures.\r\n"
+     ]
+    }
+   ],
+   "source": [
+    "!python3 -m doctest codes/summa_wrongdoc.py"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (interactive mode)\n",
+    "* Use pydoc or help() to find out the content of primes\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# functional programming"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## everything is an object\n",
+    "In Python everything is an object, even a function. Therefore, we can associate symbolic names even to the functions:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 40,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "22"
+      ]
+     },
+     "execution_count": 40,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "def summa(a, b):\n",
+    "    return a + b\n",
+    "\n",
+    "somma = summa\n",
+    "somma(10, 12)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functions as arguments of functions\n",
+    "Since you can assign a symbolic name to a function, you can even pass a function as an argument to another function:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 41,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def summa(a, b): return a+b\n",
+    "def sub(a, b): return a-b\n",
+    "def g(x, f): return f(x, x+1)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 42,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 42,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "g(1, summa)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 43,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "-1"
+      ]
+     },
+     "execution_count": 43,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "g(1, sub)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sort\n",
+    "A good example of a function that takes a function as an argument is the sorting of lists.\n",
+    "\n",
+    "The method `sort` of list, that we have seen, can receive an optional parameter keyword-only type function. If this parameter is supplied, it must be a function of one argument that, given a list item, returns the key to sort by."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 44,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "lst = [20, 10, 30]\n",
+    "def f(x): \n",
+    "    return x"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 45,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[10, 20, 30]"
+      ]
+     },
+     "execution_count": 45,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lst.sort(key=f)  # WARNING: key is a keyword-only argument, \n",
+    "                 # it can not be passed by position\n",
+    "lst"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sort"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 46,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[30, 10, 20]"
+      ]
+     },
+     "execution_count": 46,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "def g(x):\n",
+    "    return x % 3\n",
+    "\n",
+    "lst.sort(key=g)\n",
+    "lst"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sort\n",
+    "\n",
+    "Let's see in detail the latest example to understand how it works:\n",
+    "\n",
+    "```python\n",
+    ">>> lst = [10, 20, 30]\n",
+    ">>> def g(x):\n",
+    "...     return x % 3           \n",
+    "...                        \n",
+    ">>> lst.sort(key=g)   # lst:  [10, 20, 30]\n",
+    ">>> lst               # keys: [10%3, 20%3, 30%3] == [1, 2, 0] \n",
+    "[30, 10, 20]          # tmp: [(10, 1), (20, 2), (30, 0)]\n",
+    ">>>                   # stmp:  [(30, 0), (10, 1), (20, 2)] \n",
+    "                      # sorted_lst: [30, 20, 10]\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sort"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 47,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[(2, -3, 6), (10, 0, 4), (1, 2, 2), (-1, 9, 1)]"
+      ]
+     },
+     "execution_count": 47,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = [(1, 2, 2), (-1, 9, 1), (10, 0, 4), (2, -3, 6)]\n",
+    "\n",
+    "def getkey1(x): \n",
+    "    return x[1]\n",
+    "\n",
+    "l.sort(key=getkey1)\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 48,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[(-1, 9, 1), (1, 2, 2), (2, -3, 6), (10, 0, 4)]"
+      ]
+     },
+     "execution_count": 48,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "def getkey2(x):\n",
+    "    return x[0]-x[1]\n",
+    "\n",
+    "l.sort(key=getkey2)\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "* As seen above it works also in python2.\n",
+    "* But in this case we must be careful, because list.sort in python2 accepts positionally a function of a different type, which takes two arguments. So be careful to always use `key=...` also in python2!\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## lambda functions\n",
+    "\n",
+    "Within the functional programming paradigm, for which python provides a dicent support, it is often necessary to define small functions to be passed as an argument to other functions.\n",
+    "\n",
+    "Lambda functions are \"anonymous\" funxtions made in a single line, simple and compact.\n",
+    "\n",
+    "They have some limitations: they can return a result of a single expression, whatever complexity. They can not execute a statement (like a=10).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lambda functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 49,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[30, 10, 20]"
+      ]
+     },
+     "execution_count": 49,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lst = [10, 20, 30]\n",
+    "lst.sort(key=lambda x: x % 3)  # \"arguments\" : \"return value\"\n",
+    "lst"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lambda functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 50,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[(2, -3), (10, 0), (1, 2), (-1, 9)]"
+      ]
+     },
+     "execution_count": 50,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = [(1, 2), (-1, 9), (10, 0), (2, -3)]  \n",
+    "l.sort(key=lambda x: x[1])   # argument=x, return value = x[1]\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 51,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[(-1, 9), (1, 2), (2, -3), (10, 0)]"
+      ]
+     },
+     "execution_count": 51,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l.sort(key=lambda x: x[0]-x[1])   # argument=x, return value = x[0]-x[1]\n",
+    "l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lambda functions\n",
+    "Lambda may receive arguments in the same way as \"normal\" functions:\n",
+    "\n",
+    "<pre>\n",
+    "lambda a, b=0, *args, kwonly0, kwonly1=None, **kwargs: ...\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## lambda functions\n",
+    "Lambda functions do not necessarily have a name, but since everything is an object, and since a name can be assigned to any object, you can do his with the lambda:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 52,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "7"
+      ]
+     },
+     "execution_count": 52,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "summa = lambda x, y: x + y\n",
+    "summa(3, 4)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## sequences\n",
+    "A sequence is any iterable object.\n",
+    "\n",
+    "The containers that we saw are iterable, therefore they are sequences. But the reverse is not true: a sequence is not necessarily a container.\n",
+    "\n",
+    "For example `range(0, 1000000000)` do not contain1000000000 elemens, but it generates them one after the other, from left (0) to right (1000000000 excluded)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functional programming\n",
+    "\n",
+    "The functional programming paradigm is based primarily on the application of functions on sequences."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functional programming\n",
+    "The functional programming paradigm is based mainly on two built-in functions:\n",
+    "\n",
+    "* `filter`: applies a filter to a sequence\n",
+    "* `map`: apply a function to all elements of a sequence\n",
+    "\n",
+    "Warning: they return iterables, not lists or tuples."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## filter\n",
+    "The function `filter(cond, seq)` returns a sequence of all the elements of `seq` that satisfy the condition `cond`.\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 56,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 5, 10, 15, 20, 25]"
+      ]
+     },
+     "execution_count": 56,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(30))\n",
+    "list(filter(lambda x: x%5 == 0, l))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 57,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 1, 2]"
+      ]
+     },
+     "execution_count": 57,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(filter(lambda x: x < 3, l))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## map\n",
+    "The function `map(function, sequence)` returns a sequence of length equal to `sequence`, whose \n",
+    "elements are obtained by applying the `function` to every element of `sequence`."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 58,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]"
+      ]
+     },
+     "execution_count": 58,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = list(range(10))\n",
+    "list(map(lambda x: x**2, l))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 59,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[100, 101, 102, 103, 104, 105, 106, 107, 108, 109]"
+      ]
+     },
+     "execution_count": 59,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(map(lambda x: x+100, l))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## functools.reduce\n",
+    "\n",
+    "There is a third type of function `functools.reduce(function, sequence)` (contained in the `functools` module) that performs the reduction operation: `sequence` is associated to a scalar, obtained by repeatedly applying the `function` to the elements of `sequence`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "\n",
+    "In python2 filter and map functions always returnlists, not sequences. \n",
+    "\n",
+    "Moreover, `reduce` is a built-in function (therefore you do not need to import any module). It was moved into `functools` module because it is rarely used.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## sum, min, max\n",
+    "They are reduction functions to obtain the sum, the minimum and the maximum of a sequence of elements:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 60,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "45"
+      ]
+     },
+     "execution_count": 60,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = range(10)\n",
+    "sum(l)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 61,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0"
+      ]
+     },
+     "execution_count": 61,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "min(l)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 62,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "9"
+      ]
+     },
+     "execution_count": 62,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "max(l)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (books.py)\n",
+    "* Starting from the dictionary “book: author”, build a list of all the books whose title does not contain the character \"a\".\n",
+    "\n",
+    "* Starting from the dictionary “book: author”, build a list of all the books, sorted by author name"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## list comprehension\n",
+    "Is called `list comprehension` the ability to perform complex operations in a single expression on the lists."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 63,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
+      ]
+     },
+     "execution_count": 63,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = range(10)\n",
+    "[i+1 for i in l]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 64,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 9, 36, 81]"
+      ]
+     },
+     "execution_count": 64,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "[i**2 for i in l if i%3==0]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## list comprehension\n",
+    "\n",
+    "Creating a \"matrix\" 7x10:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 65,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+       " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+       " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+       " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+       " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+       " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+       " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]"
+      ]
+     },
+     "execution_count": 65,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "[[0 for i in range(10)] for i in range(7)]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## list comprehension\n",
+    "Cartesian product or combinations:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 66,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[(1, 'a', 9),\n",
+       " (1, 'a', 8),\n",
+       " (1, 'a', 7),\n",
+       " (1, 'b', 9),\n",
+       " (1, 'b', 8),\n",
+       " (1, 'b', 7),\n",
+       " (2, 'a', 9),\n",
+       " (2, 'a', 8),\n",
+       " (2, 'a', 7),\n",
+       " (2, 'b', 9),\n",
+       " (2, 'b', 8),\n",
+       " (2, 'b', 7),\n",
+       " (4, 'a', 9),\n",
+       " (4, 'a', 8),\n",
+       " (4, 'a', 7),\n",
+       " (4, 'b', 9),\n",
+       " (4, 'b', 8),\n",
+       " (4, 'b', 7)]"
+      ]
+     },
+     "execution_count": 66,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l1 = [1, 2, 4]\n",
+    "l2 = ['a', 'b']\n",
+    "l3 = [9, 8, 7]\n",
+    "[(e1,e2,e3) for e1 in l1 for e2 in l2 for e3 in l3]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (books.py)\n",
+    "Starting from the dictionary “book: author”, build a list of all the books whose title does not contain the character \"a\" using the list comprehension.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/08-String_formatting.ipynb b/08-String_formatting.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..665c35e01fa7d22f0b3cc4783d436cbf2eab2ebc
--- /dev/null
+++ b/08-String_formatting.ipynb
@@ -0,0 +1,1091 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# string formatting"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "\n",
+    "There are two functions to convert an object to a string: `str` e `repr`.\n",
+    "\n",
+    "The call to `str(x)` is equivalent to `x.__str__()` if the object `x` has a metod `__str__`, otherwise `x.__repr__()` is called. \n",
+    "\n",
+    "All objects have automatically a metod `__repr__`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "\n",
+    "When an object is printed, for example,\n",
+    "\n",
+    "```python\n",
+    ">>> print(x)\n",
+    "```\n",
+    "\n",
+    "the object will be converted to a string; this occurs through `str`, therefore is equivalent to this:\n",
+    "\n",
+    "```python\n",
+    ">>> print(str(x))\n",
+    "```\n",
+    "\n",
+    "i.e. will be printed the result of `x.__str__` if `x` has a metod `__str__`, `x.__repr__` otherwise."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "\n",
+    "We can force the use of str or repr; with strings it is possible to see the difference:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 67,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello, world!\n"
+     ]
+    }
+   ],
+   "source": [
+    "a = \"Hello, world!\"\n",
+    "print(a)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 68,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello, world!\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(str(a))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 69,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "'Hello, world!'\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(repr(a))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "\n",
+    "Printing a standard container (lists, tuples, dictionaries or sets), the elements are always printed by repr:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 70,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello, world!\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(a) # str(a)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 71,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "['Hello, world!']\n"
+     ]
+    }
+   ],
+   "source": [
+    "print([a]) # repr(a)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "\n",
+    "In practice, `repr` should return a representation of the object closest to the one \"internal\". For built-in types, the output of `repr` is equivalent to a literal constant that defines an equivalent object:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 72,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "hello\n"
+     ]
+    }
+   ],
+   "source": [
+    "a = 'hello'\n",
+    "print(str(a))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 73,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "'hello'\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(repr(a))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "Now we know what happens when we write an expression in the interactive mode: the result is printed with `repr` and not with `str`:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 74,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'hello'"
+      ]
+     },
+     "execution_count": 74,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = 'hello'\n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## str and repr\n",
+    "\n",
+    "In practice repr is used in contexts where it is good to avoid ambiguity with respect to the representation; for example withstrings:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 75,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "51"
+      ]
+     },
+     "execution_count": 75,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "11 + 40"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 76,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'51'"
+      ]
+     },
+     "execution_count": 76,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "'5' + '1'"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "If it were used str in place of repr, in both cases the output would be the same!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## string formatting\n",
+    "\n",
+    "Python supports two modes of string formatting, one old and one new.\n",
+    "\n",
+    "Although the new is better and highly recommended, it is necessary to know both, because the old is still widely used.\n",
+    "\n",
+    "Even python2 (> 2.6) implements the new mode.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## string formatting\n",
+    "String formatting is used to replace portions of a string with the value of the generic type, getting a new string.\n",
+    "\n",
+    "Normally it is used to format program output by printingtext and numerical information; for example:\n",
+    "\n",
+    "<pre>\n",
+    "$ my_wonderful_program 5 10\n",
+    "The result of expression 5 + 10 is 15.\n",
+    "$\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## “old-style” string formatting\n",
+    "The oldest mode is similar to that used for the C `printf` function."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 77,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'The result for 5 + 10 is 15'"
+      ]
+     },
+     "execution_count": 77,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a, b = 5, 10\n",
+    "\"The result for %d + %d is %d\" % (a, b, a+b)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 78,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'The result for 0.100 + 002 is +2'"
+      ]
+     },
+     "execution_count": 78,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a, b = 0.1, 2\n",
+    "\"The result for %.3f + %03d is %+d\" % (a, b, a+b)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “old-style” string formatting\n",
+    "The association between format specifiers and parameters can also be done by name:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 79,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'10 + 20 + 30'"
+      ]
+     },
+     "execution_count": 79,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dct = {\n",
+    "    'a': 10,\n",
+    "    'b': 20,\n",
+    "    'c': 30,\n",
+    "}\n",
+    "\"%(a)d + %(b)d + %(c)d\" % dct"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “old-style” string formatting\n",
+    "Unlike the C `printf`, the format specifier `%s` can be used for any value, because it uses the conversion to string through `str()`:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 80,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "10, ciao, 5.4\n"
+     ]
+    }
+   ],
+   "source": [
+    "a, b, c = 10, \"ciao\", 5.4\n",
+    "print(\"%s, %s, %s\" % (a, b, c))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "It uses string's method `format()`."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 81,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My name is James Bond.'"
+      ]
+     },
+     "execution_count": 81,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"My name is {0} {1}.\".format(\"James\", \"Bond\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 82,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My name is Bond James.'"
+      ]
+     },
+     "execution_count": 82,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"My name is {1} {0}.\".format(\"James\", \"Bond\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "If you want to maintain the order of positional arguments of format, like in the first example, you can omit the index:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 83,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My name is James Bond.'"
+      ]
+     },
+     "execution_count": 83,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"My name is {} {}.\".format(\"James\", \"Bond\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "\n",
+    "You can refer to the name of the format arguments passing them by name:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 84,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My Name is James Bond.'"
+      ]
+     },
+     "execution_count": 84,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"My Name is {name} {surname}.\".format(surname=\"Bond\", name=\"James\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "\n",
+    "Of course you can print twice the same argument:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 85,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My name is Bond. James Bond.'"
+      ]
+     },
+     "execution_count": 85,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"My name is {1}. {0} {1}.\".format(\"James\", \"Bond\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 86,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My name is Bond. James Bond.'"
+      ]
+     },
+     "execution_count": 86,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"My name is {s}. {n} {s}.\".format(n=\"James\", s=\"Bond\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "\n",
+    "You can access at the elements of a list:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 87,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'two + one + zero + four = seven'"
+      ]
+     },
+     "execution_count": 87,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lst = [\"zero\", \"one\", \"two\", \"three\", \"four\", \"five\",\"six\", \"seven\", \"eight\", \"nine\", \"ten\"]\n",
+    "\n",
+    "\"{a[2]} + {a[1]} + {a[0]} + {a[4]} = {a[7]}\".format(a=lst)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "It is possible to access at the elements in a dictionary:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 88,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'0, 2'"
+      ]
+     },
+     "execution_count": 88,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "abc = {'a': 0, 'b':1, 'c':2}\n",
+    "\n",
+    "\"{d[a]}, {d[c]}\".format(d=abc)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "\n",
+    "You can specify the format in which to print:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 89,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'10 / 3 = 3.33'"
+      ]
+     },
+     "execution_count": 89,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"{0:d} / {1:d} = {2:.2f}\".format(10, 3, 10 / 3)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "Format specifications are very similar to those of the old-style formatting."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## “new-style” string formatting\n",
+    "It is possible also specify whether an item should be converted to string with `str` or `repr`:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 90,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "abc : 'abc'\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(\"{0!s} : {0!r}\".format(\"abc\"))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (books.py)\n",
+    "* Print the entire contents of the dictionary “book: author” with a format similar to this:\n",
+    "* Umberto Eco wrote the book 'Il nome della rosa'.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## string interpolation / f-strings (python 3.6+)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "name = 'James'\n",
+    "surname = 'Bond'"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'My name is Bond. James Bond.'"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "f'My name is {surname}. {name} {surname}.'"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## string interpolation / f-strings (python 3.6+)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "one = 1 ; two = 2 ; half = 1/2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'1 / 2 = 0.5'"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "f'{one} / {two} = {half}'"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'1 / 2 = 0.5'"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "f'{one} / {two} = {one/two}'"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## string interpolation / f-strings (python 3.6+)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def greet(name, question):\n",
+    "    return f\"Hello, {name}! How's it {question}?\""
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "\"Hello, Bob! How's it going?\""
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "greet('Bob', 'going') "
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/09-Modules.ipynb b/09-Modules.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..3a661e63f03206dea2416c3276f41d9ceca71846
--- /dev/null
+++ b/09-Modules.ipynb
@@ -0,0 +1,440 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# modules"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules\n",
+    "A file with extension .py is a python module. A module can contain any type of python code.\n",
+    "\n",
+    "The module can have its own doc string.\n",
+    "\n",
+    "The modules can also have extension .so, if they are produced from source C through python C-API.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules\n",
+    "For example:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/nicola/Work/corso_Python/intro-python/codes\n",
+      "def hello_world():\r\n",
+      "    print(\"Hello, World!\")\r\n"
+     ]
+    }
+   ],
+   "source": [
+    "%cd codes\n",
+    "%cat hw.py"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['__builtins__',\n",
+       " '__cached__',\n",
+       " '__doc__',\n",
+       " '__file__',\n",
+       " '__loader__',\n",
+       " '__name__',\n",
+       " '__package__',\n",
+       " '__spec__',\n",
+       " 'hello_world']"
+      ]
+     },
+     "execution_count": 14,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import hw\n",
+    "dir(hw)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modeules"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/nicola/Work/corso_Python/intro-python/codes/hw.py\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(hw.__file__)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello, World!\n"
+     ]
+    }
+   ],
+   "source": [
+    "hw.hello_world()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules\n",
+    "The module has an attribute `__name__` which coincides with the name of the module itself.\n",
+    "\n",
+    "But the module is basically a normal python source (the only element needed is the extension .py), so it can also be run as a program.\n",
+    "\n",
+    "In this case, the value of `__name__` is the string `\"__main__\"`.\n",
+    "\n",
+    "You can use this attribute to write modules that contain a \"main\" test; just add the code test, conditioned to the value of `__name__`."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "#!/usr/bin/env python3\r\n",
+      "\r\n",
+      "def name():\r\n",
+      "    print(__name__)\r\n",
+      "\r\n",
+      "def hello_world():\r\n",
+      "    print(\"Hello, World!\")\r\n",
+      "\r\n",
+      "if __name__ == \"__main__\":\r\n",
+      "    name()\r\n",
+      "    hello_world()\r\n",
+      "    \r\n"
+     ]
+    }
+   ],
+   "source": [
+    "%cat hw_name.py"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "__main__\n",
+      "Hello, World!\n"
+     ]
+    }
+   ],
+   "source": [
+    "%run hw_name.py"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "hw_name\n"
+     ]
+    }
+   ],
+   "source": [
+    "import hw_name\n",
+    "hw_name.name()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules\n",
+    "A module can be imported in several ways:\n",
+    "\n",
+    "```python\n",
+    ">>> import mymodule\n",
+    ">>> mymodule.myf1()\n",
+    ">>> from mymodule import myf1, myf2\n",
+    ">>> myf1()\n",
+    ">>> from mymodule import myf1 as yourf1\n",
+    ">>> yourf1()\n",
+    ">>> from mymodule import *\n",
+    ">>> myf10()\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## modules\n",
+    "Importing from a module with `'*'`, by default it imports all the symbols of the module whose name does not begin with an underscore.\n",
+    "\n",
+    "If the module contains a variable `__all__`, this must be a list of the names of the symbols imported when importing with `'*'`.\n",
+    "<pre>\n",
+    "$ cat my.py\n",
+    "__all__ = [ 'hi_folk']\n",
+    "...\n",
+    "</pre>\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## packages\n",
+    "The modules can be grouped into packages, which have a hierarchical structure represented by directories. A directory that contains an `__init__.py` file, possibly empty, is a valid python package. If the directory contains other packages or modules, they are available as package content.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## packages\n",
+    "\n",
+    "```\n",
+    "sound/                 Top-level package\n",
+    "    __init__.py        Initialize the sound package\n",
+    "    formats/           Subpackage for file format conversions\n",
+    "        __init__.py   \n",
+    "        aiffread.py   \n",
+    "        aiffwrite.py \n",
+    "        auread.py\n",
+    "        auwrite.py \n",
+    "        ...\n",
+    "    effects/           Subpackage for sound effects\n",
+    "        __init__.py \n",
+    "        echo.py \n",
+    "        surround.py\n",
+    "        reverse.py \n",
+    "        ...\n",
+    "    filters/           Subpackage for filters\n",
+    "        __init__.py  \n",
+    "        equalizer.py \n",
+    "        vocoder.py\n",
+    "        karaoke.py \n",
+    "        ...\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## packages\n",
+    "\n",
+    "```python\n",
+    ">>> import sound.effects.echo.echofilter\n",
+    ">>> sound.effects.echo.echofilter(...)\n",
+    ">>> import sound.effects.echo\n",
+    ">>> sound.effects.echo.echofilter(...)\n",
+    ">>> from sound.effects import echo\n",
+    ">>> echo.echofilter(...)\n",
+    ">>> from sound.effects.echo import echofilter\n",
+    ">>> echofilter(...)\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## packages\n",
+    "\n",
+    "As for the modules, you can import with `'*'` from a package, but only if `__init__.py` defines `__all__=[...]`; In fact, the determination of the module name from the files contained in the directory of the package is not possible in Windows (case insensitive file names).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (interactive mode)\n",
+    "\n",
+    "* In interactive mode import the module \"primes\", discover the content and try to use the functions of the module.\n",
+    "* Try to import the module \"math\" and to discover its content.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/10-Standard_library.ipynb b/10-Standard_library.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..8af4043108dd11324ccbc908fcacaddc68ede5db
--- /dev/null
+++ b/10-Standard_library.ipynb
@@ -0,0 +1,1362 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# standard library (quick overview)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Operating System Interface\n",
+    "\n",
+    "The `os` module provides dozens of functions for interacting with the operating system:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'/home/nicola/Work/corso_Python/intro-python'"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import os\n",
+    "os.getcwd() # Return the current working directory"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "os.mkdir('files')   # Create a directory\n",
+    "os.chdir('files')   # Change current working directory\n",
+    "os.system('touch pippo.txt')   # Run the command touch in the system shell"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'/home/nicola/Work/corso_Python/intro-python/files'"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "os.getcwd()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Operating System Interface\n",
+    "\n",
+    "Be sure to use the `import os` style instead of `from os import *`. This will keep `os.open()` from shadowing the built-in `open()` function which operates much differently.\n",
+    "\n",
+    "The built-in `dir()` and `help()` functions are useful as interactive aids for working with large modules like `os`."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Operating System Interface\n",
+    "\n",
+    "The module `os.path` implements some useful functions on pathnames:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'/home/nicola/Work/corso_Python/intro-python/files/pippo.txt'"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "filename = os.path.abspath('pippo.txt')\n",
+    "filename"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'pippo.txt'"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "os.path.basename(filename)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "os.path.exists(filename)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Operating System Interface\n",
+    "\n",
+    "For daily file and directory management tasks, the `shutil` module provides a higher level interface that is easier to use:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'./command_line_argv.py'"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import shutil\n",
+    "shutil.copyfile('../codes/command_line_argv.py', './command_line_argv.py')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'./command_line_arguments.py'"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "shutil.copyfile('../codes/command_line_arguments.py', './command_line_arguments.py')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'pluto.txt'"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "shutil.move('pippo.txt', 'pluto.txt')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## File Wildcards\n",
+    "\n",
+    "The `glob` module provides a function for making file lists from directory wildcard searches:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['command_line_arguments.py', 'command_line_argv.py']"
+      ]
+     },
+     "execution_count": 12,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import glob\n",
+    "glob.glob('*.py')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Error Output Redirection and Program Termination\n",
+    "\n",
+    "The `sys` module has attributes for `stdin`, `stdout`, and `stderr`. The latter is useful for emitting warnings and error messages to make them visible even when `stdout` has been redirected:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "Warning, log file not found starting a new one\n"
+     ]
+    }
+   ],
+   "source": [
+    "import sys\n",
+    "sys.stderr.write('Warning, log file not found starting a new one\\n')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "The most direct way to terminate a script is to use `sys.exit()`."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Command Line Arguments\n",
+    "\n",
+    "Common utility scripts often need to process command line arguments. These arguments are stored in the `sys` module’s `argv` attribute as a list."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "['command_line_argv.py', 'pippo', 'pluto', 'paperino', '1', '2', '3']\n"
+     ]
+    }
+   ],
+   "source": [
+    "%run command_line_argv.py pippo pluto paperino 1 2 3"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "The `getopt` module processes `sys.argv` using the conventions of the Unix `getopt()` function. More powerful and flexible command line processing is provided by the `argparse` module."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Command Line Arguments\n",
+    "\n",
+    "The `argparse` module makes it easy to write user-friendly command-line interfaces."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "import argparse\r\n",
+      "import sys\r\n",
+      "import os\r\n",
+      "\r\n",
+      "def get_arguments():\r\n",
+      "    parser = argparse.ArgumentParser(description='A description of the program.')\r\n",
+      "\r\n",
+      "    parser.add_argument('-i', '--input', metavar='FILE', \r\n",
+      "                        dest='input', required=True,\r\n",
+      "                        help='Input file.')\r\n",
+      "    \r\n",
+      "    parser.add_argument('-o', '--output', metavar='FILE', \r\n",
+      "                        dest='output', default='file.out',\r\n",
+      "                        help='Output file.')\r\n",
+      "    \r\n",
+      "    parser.add_argument('-c, --check', dest='check', action='store_true',\r\n",
+      "                        help='Check if output file exists.')\r\n",
+      "    \r\n",
+      "    args = parser.parse_args()\r\n",
+      "    \r\n",
+      "    if not os.path.exists(args.input):\r\n",
+      "        sys.exit('Error: input file is missing.')\r\n",
+      "    if args.check and os.path.exists(args.output):\r\n",
+      "        sys.exit('Error: output file already exists.')\r\n",
+      "    \r\n",
+      "    return args\r\n",
+      "\r\n",
+      "\r\n",
+      "if __name__ == '__main__':\r\n",
+      "    args = get_arguments()\r\n",
+      "    \r\n",
+      "    with open(args.output, 'w') as f:\r\n",
+      "        f.write(args.input +'\\n')\r\n",
+      "        f.write(args.output +'\\n')\r\n",
+      "        f.write(str(args.check) +'\\n')\r\n"
+     ]
+    }
+   ],
+   "source": [
+    "%cat command_line_arguments.py"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Command Line Arguments"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "usage: command_line_arguments.py [-h] -i FILE [-o FILE] [-c, --check]\n",
+      "\n",
+      "A description of the program.\n",
+      "\n",
+      "optional arguments:\n",
+      "  -h, --help            show this help message and exit\n",
+      "  -i FILE, --input FILE\n",
+      "                        Input file.\n",
+      "  -o FILE, --output FILE\n",
+      "                        Output file.\n",
+      "  -c, --check           Check if output file exists.\n"
+     ]
+    }
+   ],
+   "source": [
+    "%run command_line_arguments.py -h"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Command Line Arguments"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "%run command_line_arguments.py -i pluto.txt"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "pluto.txt\r\n",
+      "file.out\r\n",
+      "False\r\n"
+     ]
+    }
+   ],
+   "source": [
+    "%cat file.out"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## String Pattern Matching\n",
+    "\n",
+    "The `re` module provides _regular expression_ tools for advanced string processing. For complex matching and manipulation, regular expressions offer succinct, optimized solutions:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['foot', 'fell', 'fastest']"
+      ]
+     },
+     "execution_count": 20,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import re\n",
+    "re.findall(r'\\bf[a-z]*', 'which foot or hand fell fastest')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'cat in the hat'"
+      ]
+     },
+     "execution_count": 21,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "re.sub(r'(\\b[a-z]+) \\1', r'\\1', 'cat in the the hat')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Mathematics\n",
+    "\n",
+    "The `math` module gives access to the underlying `C` library functions for floating point math:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0.7071067811865476"
+      ]
+     },
+     "execution_count": 22,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import math\n",
+    "math.cos(math.pi / 4)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10.0"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "math.log(1024, 2)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Mathematics\n",
+    "\n",
+    "The `random` module provides tools for making random selections:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'banana'"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import random\n",
+    "random.choice(['apple', 'pear', 'banana'])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[6, 47, 92, 39, 2, 9, 69, 45, 62, 55]"
+      ]
+     },
+     "execution_count": 25,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "random.sample(range(100), 10)   # sampling without replacement"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0.5449019645944501"
+      ]
+     },
+     "execution_count": 26,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "random.random()    # random float"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 27,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "random.randrange(6)    # random integer chosen from range(6)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Dates and Times\n",
+    "\n",
+    "The `datetime` module supplies classes for manipulating dates and times in both simple and complex ways."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "datetime.date(2018, 3, 27)"
+      ]
+     },
+     "execution_count": 28,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "from datetime import date\n",
+    "now = date.today()\n",
+    "now"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "'03-27-18. 27 Mar 2018 is a Tuesday on the 27 day of March.'"
+      ]
+     },
+     "execution_count": 29,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "now.strftime(\"%m-%d-%y. %d %b %Y is a %A on the %d day of %B.\")"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "19597"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "birthday = date(1964, 7, 31)\n",
+    "age = now - birthday    # dates support calendar arithmetic\n",
+    "age.days"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Logging\n",
+    "\n",
+    "The `logging` module offers a full featured and flexible logging system. At its simplest, log messages are sent to a file or to `sys.stderr`."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "WARNING:root:Warning:config file server.conf not found\n",
+      "ERROR:root:Error occurred\n",
+      "CRITICAL:root:Critical error -- shutting down\n"
+     ]
+    }
+   ],
+   "source": [
+    "import logging\n",
+    "logging.debug('Debugging information')\n",
+    "logging.info('Informational message')\n",
+    "logging.warning('Warning:config file %s not found', 'server.conf')\n",
+    "logging.error('Error occurred')\n",
+    "logging.critical('Critical error -- shutting down')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "The logging system can be configured directly from Python or can be loaded from a user editable configuration file for customized logging without altering the application."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Data Compression\n",
+    "\n",
+    "Common data archiving and compression formats are directly supported by modules including: `zlib`, `gzip`, `bz2`, `lzma`, `zipfile` and `tarfile`."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import gzip\n",
+    "content = b\"Lots of content here\"\n",
+    "with gzip.open('paperino.txt.gz', 'wb') as f:\n",
+    "    f.write(content)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 33,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "with gzip.open('paperino.txt.gz', 'rb') as f:\n",
+    "    file_content = f.read()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 34,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "b'Lots of content here'"
+      ]
+     },
+     "execution_count": 34,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "file_content"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## CSV File Reading and Writing"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 35,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import csv\n",
+    "with open('eggs.csv', 'w', newline='') as csvfile:\n",
+    "    spamwriter = csv.writer(csvfile, delimiter=',',\n",
+    "                            quotechar='\"', quoting=csv.QUOTE_MINIMAL)\n",
+    "    spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n",
+    "    spamwriter.writerow(['Spam', 'Lovely, Spam', 'Wonderful, Spam'])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 36,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "['Spam', 'Spam', 'Spam', 'Spam', 'Spam', 'Baked Beans']\n",
+      "['Spam', 'Lovely, Spam', 'Wonderful, Spam']\n"
+     ]
+    }
+   ],
+   "source": [
+    "with open('eggs.csv', 'r', newline='') as csvfile:\n",
+    "    spamreader = csv.reader(csvfile, delimiter=',', quotechar='\"')\n",
+    "    for row in spamreader:\n",
+    "        print(row)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## JSON encoder and decoder"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 37,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "spanish = {'hello': 'hola', 'yes': 'si', 'one': 'uno', 'two': 'dos', 'three': 'tres',\n",
+    "           'red': 'rojo', 'black': 'negro', 'green': 'verde', 'blue': 'azul'}\n",
+    "import json\n",
+    "with open('spanish.json', 'w') as f:\n",
+    "    json.dump(spanish, f)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 38,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'black': 'negro',\n",
+       " 'blue': 'azul',\n",
+       " 'green': 'verde',\n",
+       " 'hello': 'hola',\n",
+       " 'one': 'uno',\n",
+       " 'red': 'rojo',\n",
+       " 'three': 'tres',\n",
+       " 'two': 'dos',\n",
+       " 'yes': 'si'}"
+      ]
+     },
+     "execution_count": 38,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "with open('spanish.json', 'r') as f:\n",
+    "    data = json.load(f)\n",
+    "data"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Interface for SQLite databases"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 39,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import sqlite3\n",
+    "conn = sqlite3.connect('example.db')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 40,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "<sqlite3.Cursor at 0x7fdf7443a6c0>"
+      ]
+     },
+     "execution_count": 40,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "c = conn.cursor()\n",
+    "\n",
+    "# Create table\n",
+    "c.execute('''CREATE TABLE stocks\n",
+    "             (date text, trans text, symbol text, qty real, price real)''')\n",
+    "\n",
+    "# Insert a row of data\n",
+    "c.execute(\"INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Interface for SQLite databases"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 41,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# Larger example that inserts many records at a time\n",
+    "purchases = [('2006-03-28', 'BUY', 'IBM', 1000, 45.00),\n",
+    "             ('2006-04-05', 'BUY', 'MSFT', 1000, 72.00),\n",
+    "             ('2006-04-06', 'SELL', 'IBM', 500, 53.00),\n",
+    "            ]\n",
+    "c.executemany('INSERT INTO stocks VALUES (?,?,?,?,?)', purchases)\n",
+    "\n",
+    "# Save (commit) the changes\n",
+    "conn.commit()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Interface for SQLite databases"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 42,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "('2006-01-05', 'BUY', 'RHAT', 100.0, 35.14)\n",
+      "('2006-03-28', 'BUY', 'IBM', 1000.0, 45.0)\n",
+      "('2006-04-06', 'SELL', 'IBM', 500.0, 53.0)\n",
+      "('2006-04-05', 'BUY', 'MSFT', 1000.0, 72.0)\n"
+     ]
+    }
+   ],
+   "source": [
+    "for row in c.execute('SELECT * FROM stocks ORDER BY price'):\n",
+    "    print(row)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 43,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "conn.close() "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## Subprocess management\n",
+    "\n",
+    "The `subprocess` module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 44,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "from subprocess import Popen, PIPE\n",
+    "pid = Popen(['ls', '-l'], stdout=PIPE)\n",
+    "pid.wait()\n",
+    "outs, errs = pid.communicate()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 45,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "total 64\n",
+      "-rw-r--r-- 1 nicola nicola 1069 Mar 27 17:19 command_line_arguments.py\n",
+      "-rw-r--r-- 1 nicola nicola   28 Mar 27 17:17 command_line_argv.py\n",
+      "-rw-r--r-- 1 nicola nicola   77 Mar 27 17:22 eggs.csv\n",
+      "-rw-r--r-- 1 nicola nicola 8192 Mar 27 17:23 example.db\n",
+      "-rw-r--r-- 1 nicola nicola   25 Mar 27 17:20 file.out\n",
+      "-rw-r--r-- 1 nicola nicola   53 Mar 27 17:21 paperino.txt.gz\n",
+      "-rw-r--r-- 1 nicola nicola    0 Mar 27 17:16 pluto.txt\n",
+      "-rw-r--r-- 1 nicola nicola  142 Mar 27 17:22 spanish.json\n",
+      "\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(outs.decode(\"utf-8\"))"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/11-Scientific_modules.ipynb b/11-Scientific_modules.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..86ad308f5908d028d3981034657803f9365cfc34
--- /dev/null
+++ b/11-Scientific_modules.ipynb
@@ -0,0 +1,3101 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# Scientific Modules (very quick introduction)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Where are the bottlenecks?\n",
+    "Let’s start by trying to understand why high level languages like Python are slower than compiled code\n",
+    "\n",
+    "\n",
+    "In Python the main reasons of the \"slowness\" of the code are:\n",
+    "\n",
+    "- Dynamic Typing\n",
+    "- Data (memory) Access "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Solution\n",
+    "* NumPy offers efficient array storing and computation\n",
+    "* Python scientific libraries (i.e. scipy, matplotlib, pandas) make use of NumPy objects\n",
+    "* NumPy is the __de facto__ standard"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## Scientific Modules"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "![](images/scientific-python-stack.jpg)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# numpy"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## numpy\n",
+    "\n",
+    "Default for this presentation (and for the standard documentation)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import numpy as np"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "NumPy provides two main objects:\n",
+    "* `ndarray`\n",
+    "* `ufunc`"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    "\n",
+    "An `ndarray` is a collection of __homogeneous__ items:\n",
+    "* Each item occupies the same number of bytes\n",
+    "* Items typically are numerical type\n",
+    "* But an arbitrary __record__ of (non) numerical types can be used\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    "\n",
+    "Examples:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1., 2., 3.])"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = np.array([1., 2, 3])  # try also:\n",
+    "# b = np.array([[1.5, 2.2, 34.4], [2.3, 4, 6.5]])\n",
+    "# c = np.array(['lof', 'l', 'ga']) \n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "dtype('float64')"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a.dtype"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    "\n",
+    "Examples:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array(['lof', '3', '2'], dtype='<U3')"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "c = np.array(['lof', 3, 2])  # doesn't work asexpected\n",
+    "c"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "numpy.ndarray"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "type(a)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dtype\n",
+    "\n",
+    "A data type object (an instance of `numpy.dtype` class) describes how the bytes in the fixed-size block of memory corresponding to an array item should be interpreted. "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "dtype('int64')"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = np.array([1, 2, 3])  # buffer of 24 bytes intepreted as 3 ints\n",
+    "a.dtype                  # int64 -> 64 bits -> 8 bytes"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1., 2., 3.])"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b = a.astype(np.float)  # dtype('float64') \n",
+    "b"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dtype\n",
+    "<center>\n",
+    "![](images/dtypes.png)\n",
+    "</center>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## dtype\n",
+    "\n",
+    "The elements of `ndarrays` can be specified with a dtype object:\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "dtype('int32')"
+      ]
+     },
+     "execution_count": 12,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dt = np.dtype(np.int32)\n",
+    "dt"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1, 2, 3], dtype=int32)"
+      ]
+     },
+     "execution_count": 15,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = np.array([1, 2, 3], dtype=dt)\n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "dtype('S3')"
+      ]
+     },
+     "execution_count": 16,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "np.dtype('S3') # 3 means 3 bytes"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "dtype([('f1', '<u8'), ('f2', 'S3')])"
+      ]
+     },
+     "execution_count": 17,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "np.dtype([('f1', np.uint), ('f2', 'S3')]) # list of tuples"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(2, 3)"
+      ]
+     },
+     "execution_count": 18,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b = np.array([ [1,2,5], [3,4,6] ])\n",
+    "b.shape"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[1],\n",
+       "       [2],\n",
+       "       [5],\n",
+       "       [3],\n",
+       "       [4],\n",
+       "       [6]])"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b.shape = (6,1)  # reshaping the array\n",
+    "b"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    " \n",
+    "Intrinsic `numpy` array creation functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])"
+      ]
+     },
+     "execution_count": 22,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = np.zeros(10)\n",
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[1., 1.],\n",
+       "       [1., 1.],\n",
+       "       [1., 1.]])"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b = np.ones(shape=(3,2))\n",
+    "b"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1, 3, 5, 7, 9])"
+      ]
+     },
+     "execution_count": 25,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "d = np.arange(1,10,2)  # try also np.arange(1,10,2.)\n",
+    "d "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    " \n",
+    "Intrinsic `numpy` array creation functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([ 0.        ,  0.14492754,  0.28985507,  0.43478261,  0.57971014,\n",
+       "        0.72463768,  0.86956522,  1.01449275,  1.15942029,  1.30434783,\n",
+       "        1.44927536,  1.5942029 ,  1.73913043,  1.88405797,  2.02898551,\n",
+       "        2.17391304,  2.31884058,  2.46376812,  2.60869565,  2.75362319,\n",
+       "        2.89855072,  3.04347826,  3.1884058 ,  3.33333333,  3.47826087,\n",
+       "        3.62318841,  3.76811594,  3.91304348,  4.05797101,  4.20289855,\n",
+       "        4.34782609,  4.49275362,  4.63768116,  4.7826087 ,  4.92753623,\n",
+       "        5.07246377,  5.2173913 ,  5.36231884,  5.50724638,  5.65217391,\n",
+       "        5.79710145,  5.94202899,  6.08695652,  6.23188406,  6.37681159,\n",
+       "        6.52173913,  6.66666667,  6.8115942 ,  6.95652174,  7.10144928,\n",
+       "        7.24637681,  7.39130435,  7.53623188,  7.68115942,  7.82608696,\n",
+       "        7.97101449,  8.11594203,  8.26086957,  8.4057971 ,  8.55072464,\n",
+       "        8.69565217,  8.84057971,  8.98550725,  9.13043478,  9.27536232,\n",
+       "        9.42028986,  9.56521739,  9.71014493,  9.85507246, 10.        ])"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "c = np.linspace(0,10,70)  # start, stop, npoints \n",
+    "c"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    " \n",
+    "Creating `ndarray` reading from file"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "/home/nicola/Work/corso_Python/intro-python/data\n"
+     ]
+    }
+   ],
+   "source": [
+    "%cd ../data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([(b'C', 12,  -0.102, -0.301, -0.276),\n",
+       "       (b'C', 12,  -0.024, -0.189,  1.125),\n",
+       "       (b'C', 12,   1.254, -0.165,  1.713),\n",
+       "       (b'C', 12,   2.406, -0.245,  0.941),\n",
+       "       (b'C', 12,   2.311, -0.359, -0.456),\n",
+       "       (b'C', 12,   1.042, -0.388, -1.058),\n",
+       "       (b'C', 12,  -1.248, -0.099,  1.954),\n",
+       "       (b'C', 12,  -1.288,  0.693,  3.11 ),\n",
+       "       (b'C', 12,  -2.434,  0.786,  3.899),\n",
+       "       (b'C', 12,  -3.583,  0.07 ,  3.539),\n",
+       "       (b'C', 12,  -3.563, -0.728,  2.385),\n",
+       "       (b'C', 12,  -2.417, -0.807,  1.61 ),\n",
+       "       (b'O', 16,  -4.755,  0.081,  4.233),\n",
+       "       (b'C', 12,  -4.849,  0.871,  5.418),\n",
+       "       (b'C', 12,  -6.253,  0.694,  5.978),\n",
+       "       (b'C', 12,  -6.478,  1.501,  7.263),\n",
+       "       (b'C', 12,  -7.892,  1.324,  7.828),\n",
+       "       (b'C', 12,  -8.114,  2.125,  9.104),\n",
+       "       (b'O', 16,  -9.453,  1.885,  9.535),\n",
+       "       (b'C', 12,  -9.9  ,  2.496, 10.668),\n",
+       "       (b'C', 12, -11.226,  2.214, 11.032),\n",
+       "       (b'C', 12, -11.774,  2.784, 12.17 ),\n",
+       "       (b'C', 12, -11.027,  3.656, 12.986),\n",
+       "       (b'C', 12,  -9.706,  3.927, 12.605),\n",
+       "       (b'C', 12,  -9.138,  3.36 , 11.464),\n",
+       "       (b'C', 12, -11.617,  4.262, 14.203),\n",
+       "       (b'C', 12, -12.527,  3.546, 15.001),\n",
+       "       (b'C', 12, -13.084,  4.108, 16.143),\n",
+       "       (b'C', 12, -12.737,  5.415, 16.525),\n",
+       "       (b'C', 12, -11.828,  6.143, 15.739),\n",
+       "       (b'C', 12, -11.283,  5.572, 14.597),\n",
+       "       (b'C', 12, -13.305,  5.999, 17.703),\n",
+       "       (b'N', 14, -13.767,  6.475, 18.66 ),\n",
+       "       (b'H',  1,  -2.416, -1.453,  0.738),\n",
+       "       (b'C', 12,   3.495, -0.445, -1.257),\n",
+       "       (b'H',  1, -13.779,  3.538, 16.751),\n",
+       "       (b'H',  1, -12.781,  2.525, 14.737),\n",
+       "       (b'H',  1, -10.607,  6.158, 13.984),\n",
+       "       (b'H',  1, -11.566,  7.156, 16.025),\n",
+       "       (b'H',  1, -12.809,  2.572, 12.418),\n",
+       "       (b'H',  1, -11.807,  1.552, 10.399),\n",
+       "       (b'H',  1,  -8.109,  3.587, 11.215),\n",
+       "       (b'H',  1,  -9.091,  4.572, 13.225),\n",
+       "       (b'H',  1,  -7.406,  1.815,  9.886),\n",
+       "       (b'H',  1,  -7.966,  3.199,  8.921),\n",
+       "       (b'H',  1,  -8.637,  1.634,  7.085),\n",
+       "       (b'H',  1,  -8.083,  0.265,  8.041),\n",
+       "       (b'H',  1,  -6.293,  2.566,  7.066),\n",
+       "       (b'H',  1,  -5.74 ,  1.197,  8.019),\n",
+       "       (b'H',  1,  -6.977,  0.996,  5.212),\n",
+       "       (b'H',  1,  -6.422, -0.372,  6.169),\n",
+       "       (b'H',  1,  -4.094,  0.543,  6.148),\n",
+       "       (b'H',  1,  -4.653,  1.927,  5.183),\n",
+       "       (b'H',  1,  -2.423,  1.421,  4.777),\n",
+       "       (b'H',  1,  -0.416,  1.277,  3.389),\n",
+       "       (b'H',  1,  -4.457, -1.285,  2.126),\n",
+       "       (b'H',  1,  -1.074, -0.294, -0.759),\n",
+       "       (b'H',  1,   0.963, -0.467, -2.138),\n",
+       "       (b'H',  1,   3.384, -0.232,  1.412),\n",
+       "       (b'H',  1,   1.344, -0.109,  2.793),\n",
+       "       (b'N', 14,   4.457, -0.515, -1.908)],\n",
+       "      dtype=[('symb', 'S3'), ('PA', '<i8'), ('x', '<f8'), ('y', '<f8'), ('z', '<f8')])"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dt = np.dtype([('symb','|S3'),('PA',np.int), ('x',np.float64),('y',np.float64), ('z', np.float64)])\n",
+    "arr = np.loadtxt('mol.xyz', dtype=dt)\n",
+    "arr"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray\n",
+    "\n",
+    "Special library functions (e.g. `random`, ...) or _ad hoc_ defined function"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([0.7088413 , 0.85274121, 0.57005137, 0.54316797])"
+      ]
+     },
+     "execution_count": 31,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "np.random.rand(4)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {
+    "scrolled": false,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[1., 1., 1., 1.],\n",
+       "       [1., 2., 3., 4.],\n",
+       "       [1., 3., 5., 7.]])"
+      ]
+     },
+     "execution_count": 32,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "def func(i, j):\n",
+    "    return i*j+1\n",
+    "\n",
+    "np.fromfunction(func, (3,4))   # meshgrid"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## why a numpy array is useful?\n",
+    "\n",
+    "Memory-efficient container that provides fast numerical operations.\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 33,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "4.01 ms ± 39.9 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "L = list(range(10000))\n",
+    "\n",
+    "t1 = %timeit -o [i**2 for i in L]  # list elements squared"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 35,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "11.2 µs ± 1.92 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "a = np.arange(10000)\n",
+    "\n",
+    "t2 = %timeit -n 1000 -o a**2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 36,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "numpy speedUP: 429.7578927536461\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(\"numpy speedUP:\", t1.best/t2.best)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## ndarray attributes\n",
+    "\n",
+    "Some useful ndarray attributes are: (let arr be the array)\n",
+    "* __`arr.dtype`__ &emsp; data-type object for this array\n",
+    "```python\n",
+    "a = np.ones(10); a.dtype\n",
+    "dtype('float64')\n",
+    "```\n",
+    "* __`arr.shape`__ &emsp; returns a tuple with the size of the array. Changing the tuple re-shapes the array\n",
+    "* __`arr.ndim`__ &emsp; number of dimension in array\n",
+    "* __`arr.size`__ &emsp; total number of elements\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## (some) ndarray functions\n",
+    "Some useful ndarray functions are:\n",
+    "* __`arr.copy()`__ &emsp; returns a copy of the array\n",
+    "* __`arr.view()`__ &emsp; returns a new view of the array using the same data of arr (save memory space)\n",
+    "* __`arr.reshape()`__ &emsp; returns an array with a new shape\n",
+    "* __`arr.transpose()`__ &emsp; returns an array view with the shape transposed\n",
+    "* __`arr.sum()`__\n",
+    "* __`arr.min|max()`__ &emsp; return min (or max) value\n",
+    "* __`arr.argmin|argmax()`__ &emsp; return the index of min (max) value\n",
+    "* __`arr.var|mean|std|prod()`__ &emsp; take the usual meaning"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# matplotlib"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## matplotlib\n",
+    "* `matplotlib` makes use of `numpy` to provide __good performance__ with __large__ data arrays\n",
+    "* allows __publication quality__ plots\n",
+    "* since it's a Python module can be easily __integrated__ in a Python program\n",
+    "\n",
+    "Let us be consistent with the official documentation"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import matplotlib.pyplot as plt"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "%matplotlib inline"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## matplotlib"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 41,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VOXZ//HPlZ2QsAZCgEBYwo6CQRCxsoqgVqx1o9ZiXXBFH5eq1Kfa2mqptlptcd/QWhFpEUQUWRLcWINsAYEkLGENEAKEkP36/ZHh+QUkZJlJzpzM9X695pU5Z+4z8707di7us92iqhhjjDEnBTkdwBhjjH+xwmCMMeYUVhiMMcacwgqDMcaYU1hhMMYYcworDMYYY05hhcEYY8wprDAYY4w5hRUGY4wxpwhxOkBtxMTEaEJCQq22PX78OI0bN/ZtoHrk9vzg/j64PT+4vw9uzw/O9CE1NfWgqraqqp0rC0NCQgKrVq2q1bYpKSkMGzbMt4Hqkdvzg/v74Pb84P4+uD0/ONMHEdlRnXa2K8kYY8wprDAYY4w5hRUGY4wxp7DCYIwx5hRWGIwxxpzCJ4VBRN4WkWwR2VDJ6yIiL4lIuoisE5HzKrw2QUS2eh4TfJHHGGNM7flqxPAuM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wzkArDbiC+wnJ7zzpTTzz75f8DfKCq/3U6jzc8w/9kYIzTWWpgCHClZx/9dGCEiPzL2Ug1p6q7PX+zKZ9B0k2zQO4CdlUYac6kvFD4lUAqDCuBRBHp5DngcwMwx+FMAcNz4PYtYJOqPu90ntoQkVYi0szzvBHlJzL84Gyq6lPVyaraXlUTKP/vf7Gq/tLhWDUiIo09Jy/g2QUzGnDNmXqqug/IEpHunlUjAb87AcOrOZ/dRFVLROReYD4QDLytqmkOx6o2EfkQGAbEiMgu4ElVfcvZVDUyBLgJWO/ZRw/wW8984G4RB0zznOEWBMxQVVee8uliscCs8n9nEAL8W1W/cDZSjU0CPvD8AzUT+LXDeX4kYE5XNcYYUz2BtCvJGGNMNVhhMMYYcworDMYYY05hhcEYY8wprDAYY4w5hRUGY4wxp7DCYIwx5hRWGIwxxpzi/wGJiFPcxbneFAAAAABJRU5ErkJggg==\n",
+      "text/plain": [
+       "<Figure size 432x288 with 1 Axes>"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "# import matplotlib.pyplot as plt\n",
+    "# import numpy as np\n",
+    "x = np.linspace(0, 2*np.pi, 10**4)\n",
+    "y = np.sin(x)\n",
+    "plt.plot(x,y) \n",
+    "plt.grid()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## matplotlib\n",
+    "\n",
+    "Multiple line plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 42,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uID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5UAq86ZyL2Fo9vwG+A4d5An1kccAbZrbEe85zJBsJlAGPesNiD5lZH7+L6oArgKfDeYJoDnoJMzNLB+YB33DOVftdz+E451qdc5MJPZt4uplF7NCYmV0ElDrnlvhdSwed4pybClwA3OINQUaqBGAqcL9zbgpQB0T6Z3dJwGeB58J5nmgO+nYfQC6d5413zwOedM694Hc9HeH9mr4AON/vWo5gFvBZb+z7GeBMM/uzvyUdnnNul7cuBV4kNGQaqYqAoja/0T1PKPgj2QXAUudcSThPEs1BrweQh4n3AefDwDrn3L1+13MkZpZjZlnediqhD+fX+1vV4Tnn7nTO5Trn8gn9m/2Hc+5qn8s6JDPr430YjzcEci4QsbPGnHN7gEIzG+81nQVE3ASCg1xJmIdtIIzPjA23aHsAuZk9DZwBZJtZEfAD59zD/lZ1WLOAa4BV3tg3wPe85wBHmiHAY97MhTjgWedcRE9ZjCKDgBdDP/dJAJ5yzr3mb0nt+jrwpNf52wrM9rmew/J+eJ4D3Bj2c0Xr9EoREemYaB66ERGRDlDQi4jEOAW9iEiMU9CLiMQ4Bb2ISIxT0IuIxDgFvYhIjFPQi4jEuP8PNxupFBo0wI4AAAAASUVORK5CYII=\n",
+      "text/plain": [
+       "<Figure size 432x288 with 1 Axes>"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "x = np.arange(0,7,0.00001)\n",
+    "plt.plot(x,x**3)\n",
+    "plt.plot(x,x**2)\n",
+    "plt.show()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# scipy"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy\n",
+    "\n",
+    "`scipy` is built on top of `numpy` module, and provides a large number of higher-level scientific algorithms.\n",
+    "\n",
+    "Some of the *topics* that SciPy covers are:\n",
+    "* Special functions ([scipy.special](http://docs.scipy.org/doc/scipy/reference/special.html))\n",
+    "* Integration ([scipy.integrate](http://docs.scipy.org/doc/scipy/reference/integrate.html))\n",
+    "* Optimization ([scipy.optimize](http://docs.scipy.org/doc/scipy/reference/optimize.html))\n",
+    "* Interpolation ([scipy.interpolate](http://docs.scipy.org/doc/scipy/reference/interpolate.html))\n",
+    "* Fourier Transforms ([scipy.fftpack](http://docs.scipy.org/doc/scipy/reference/fftpack.html))\n",
+    "* Signal Processing ([scipy.signal](http://docs.scipy.org/doc/scipy/reference/signal.html))\n",
+    "* Linear Algebra ([scipy.linalg](http://docs.scipy.org/doc/scipy/reference/linalg.html))\n",
+    "* Sparse Eigenvalue Problems ([scipy.sparse](http://docs.scipy.org/doc/scipy/reference/sparse.html))\n",
+    "* Statistics ([scipy.stats](http://docs.scipy.org/doc/scipy/reference/stats.html))\n",
+    "* Multi-dimensional image processing ([scipy.ndimage](http://docs.scipy.org/doc/scipy/reference/ndimage.html))\n",
+    "* File IO ([scipy.io](http://docs.scipy.org/doc/scipy/reference/io.html))\n",
+    "\n",
+    "Each of these submodules provides a number of functions and classes that can be used to solve problems in their respective topics."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy\n",
+    "\n",
+    "We could start by importing everything from the `scipy` module\n",
+    "\n",
+    "``` python\n",
+    "# importing everything from scipy\n",
+    "from scipy import *\n",
+    "```\n",
+    "\n",
+    "**but**, if we only need to use part of the `scipy`, we can selectively include only those modules we are interested in.\n",
+    "\n",
+    "``` python\n",
+    "# Example for loading only linear algebra\n",
+    "import scipy.linalg as la\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy\n",
+    "\n",
+    "A *linear equations system* is \n",
+    "\n",
+    "$A x = b$\n",
+    "\n",
+    "where $A$ is a matrix and $x,b$ are vectors."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "#import numpy as np\n",
+    "import scipy.linalg as la\n",
+    "\n",
+    "A = np.array([[1,2,3], [4,5,6], [17,8,9]])\n",
+    "b = np.array([10,11,12])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "    Solves the linear equation set ``a * x = b`` for the unknown ``x``\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(la.solve.__doc__.split(\"\\n\")[1])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([-8.35932630e-16, -9.00000000e+00,  9.33333333e+00])"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "x = la.solve(A, b)\n",
+    "x"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([3.55271368e-15, 1.42108547e-14, 0.00000000e+00])"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# check\n",
+    "np.dot(A, x) - b"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy\n",
+    "\n",
+    "Matrix oprations"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[ 0.24881354,  3.32510739, -1.63570096],\n",
+       "       [-0.61381025, -3.82981061,  3.64685201],\n",
+       "       [ 0.86537112, -2.57027515,  1.04689948]])"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "A = np.random.rand(3,3)\n",
+    "# the matrix inverse\n",
+    "la.inv(A)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0.16769110564449569"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# determinant\n",
+    "la.det(A)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy\n",
+    "\n",
+    "Let's look at how to find the minima of a simple function of a single variable:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD9CAYAAACyYrxEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xd4XGeZ9/HvPept1Ksld9my3GRHcXpISEKcwGICSwpsCNVwbbJL25clsLuE3ZeFa3lpu+wGAvEmYUNCIAXChhJCEpP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GGOMOTsremOMiXFW9MYYE+Os6I0xJsZZ0RtjTIyzojfGmBhnRW+MMTHOit4YY2Lc/weCUs7a3aFDyQAAAABJRU5ErkJggg==\n",
+      "text/plain": [
+       "<Figure size 432x288 with 1 Axes>"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "from scipy import optimize\n",
+    "#import matplotlib.pyplot as plt\n",
+    "def f(x):\n",
+    "    return 4*x**3 + (x-2)**2 + x**4\n",
+    "# plot f(x) in x in [-5,3)\n",
+    "fig, ax  = plt.subplots()\n",
+    "x = np.linspace(-5, 3, 100)\n",
+    "ax.plot(x, f(x));"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## scipy\n",
+    "We can use the `fmin_bfgs` function to find the minima of a function:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Optimization terminated successfully.\n",
+      "         Current function value: -3.506641\n",
+      "         Iterations: 5\n",
+      "         Function evaluations: 24\n",
+      "         Gradient evaluations: 8\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "array([-2.67298151])"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# the first minimum\n",
+    "x_min = optimize.fmin_bfgs(f, -2)\n",
+    "x_min "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Optimization terminated successfully.\n",
+      "         Current function value: 2.804988\n",
+      "         Iterations: 3\n",
+      "         Function evaluations: 15\n",
+      "         Gradient evaluations: 5\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "array([ 0.46961745])"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "optimize.fmin_bfgs(f, 0.5) "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# pandas"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas\n",
+    "\n",
+    "`pandas` is the basic tool for data manipulation and analysis in Python.\n",
+    "\n",
+    "\n",
+    "It provides two primary data structures:\n",
+    "* `Series` is built for 1-dimensional data series\n",
+    "* `DataFrame` is built for 2-dimensional collections of tabular data\n",
+    "\n",
+    "These data structures differ and are related as follows:\n",
+    "* **Series**: 1-dimensional array of **homogeneous** data\n",
+    "* **DataFrame**: 2-dimensional table of **heterogeneous** data, composed of multiple **Series**"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# conventional way to import pandas\n",
+    "import pandas as pd"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# a new DataFrame reading from a file a dataset of Chipotle orders\n",
+    "orders = pd.read_table('chipotle.tsv')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "pandas.core.frame.DataFrame"
+      ]
+     },
+     "execution_count": 16,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "type(orders)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas\n",
+    "Use the method `DataFrame.head()` to inspect the first few rows of data:\n",
+    "* great way to inspect smaller data sets\n",
+    "* useful for verifying you have read the right file"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>order_id</th>\n",
+       "      <th>quantity</th>\n",
+       "      <th>item_name</th>\n",
+       "      <th>choice_description</th>\n",
+       "      <th>item_price</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>0</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chips and Fresh Tomato Salsa</td>\n",
+       "      <td>NaN</td>\n",
+       "      <td>$2.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Izze</td>\n",
+       "      <td>[Clementine]</td>\n",
+       "      <td>$3.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>2</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Nantucket Nectar</td>\n",
+       "      <td>[Apple]</td>\n",
+       "      <td>$3.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>3</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
+       "      <td>NaN</td>\n",
+       "      <td>$2.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4</th>\n",
+       "      <td>2</td>\n",
+       "      <td>2</td>\n",
+       "      <td>Chicken Bowl</td>\n",
+       "      <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n",
+       "      <td>$16.98</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "   order_id  quantity                              item_name  \\\n",
+       "0         1         1           Chips and Fresh Tomato Salsa   \n",
+       "1         1         1                                   Izze   \n",
+       "2         1         1                       Nantucket Nectar   \n",
+       "3         1         1  Chips and Tomatillo-Green Chili Salsa   \n",
+       "4         2         2                           Chicken Bowl   \n",
+       "\n",
+       "                                  choice_description item_price  \n",
+       "0                                                NaN     $2.39   \n",
+       "1                                       [Clementine]     $3.39   \n",
+       "2                                            [Apple]     $3.39   \n",
+       "3                                                NaN     $2.39   \n",
+       "4  [Tomatillo-Red Chili Salsa (Hot), [Black Beans...    $16.98   "
+      ]
+     },
+     "execution_count": 17,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# How to visualize the first five rows of the DataFrame\n",
+    "orders.head()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>order_id</th>\n",
+       "      <th>quantity</th>\n",
+       "      <th>item_name</th>\n",
+       "      <th>choice_description</th>\n",
+       "      <th>item_price</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>0</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chips and Fresh Tomato Salsa</td>\n",
+       "      <td>NaN</td>\n",
+       "      <td>$2.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Izze</td>\n",
+       "      <td>[Clementine]</td>\n",
+       "      <td>$3.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>2</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Nantucket Nectar</td>\n",
+       "      <td>[Apple]</td>\n",
+       "      <td>$3.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>3</th>\n",
+       "      <td>1</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chips and Tomatillo-Green Chili Salsa</td>\n",
+       "      <td>NaN</td>\n",
+       "      <td>$2.39</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>...</th>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4618</th>\n",
+       "      <td>1833</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Steak Burrito</td>\n",
+       "      <td>[Fresh Tomato Salsa, [Rice, Sour Cream, Cheese...</td>\n",
+       "      <td>$11.75</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4619</th>\n",
+       "      <td>1834</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chicken Salad Bowl</td>\n",
+       "      <td>[Fresh Tomato Salsa, [Fajita Vegetables, Pinto...</td>\n",
+       "      <td>$11.25</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4620</th>\n",
+       "      <td>1834</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chicken Salad Bowl</td>\n",
+       "      <td>[Fresh Tomato Salsa, [Fajita Vegetables, Lettu...</td>\n",
+       "      <td>$8.75</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>4621</th>\n",
+       "      <td>1834</td>\n",
+       "      <td>1</td>\n",
+       "      <td>Chicken Salad Bowl</td>\n",
+       "      <td>[Fresh Tomato Salsa, [Fajita Vegetables, Pinto...</td>\n",
+       "      <td>$8.75</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "<p>4622 rows × 5 columns</p>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "      order_id  quantity                              item_name  \\\n",
+       "0            1         1           Chips and Fresh Tomato Salsa   \n",
+       "1            1         1                                   Izze   \n",
+       "2            1         1                       Nantucket Nectar   \n",
+       "3            1         1  Chips and Tomatillo-Green Chili Salsa   \n",
+       "...        ...       ...                                    ...   \n",
+       "4618      1833         1                          Steak Burrito   \n",
+       "4619      1834         1                     Chicken Salad Bowl   \n",
+       "4620      1834         1                     Chicken Salad Bowl   \n",
+       "4621      1834         1                     Chicken Salad Bowl   \n",
+       "\n",
+       "                                     choice_description item_price  \n",
+       "0                                                   NaN     $2.39   \n",
+       "1                                          [Clementine]     $3.39   \n",
+       "2                                               [Apple]     $3.39   \n",
+       "3                                                   NaN     $2.39   \n",
+       "...                                                 ...        ...  \n",
+       "4618  [Fresh Tomato Salsa, [Rice, Sour Cream, Cheese...    $11.75   \n",
+       "4619  [Fresh Tomato Salsa, [Fajita Vegetables, Pinto...    $11.25   \n",
+       "4620  [Fresh Tomato Salsa, [Fajita Vegetables, Lettu...     $8.75   \n",
+       "4621  [Fresh Tomato Salsa, [Fajita Vegetables, Pinto...     $8.75   \n",
+       "\n",
+       "[4622 rows x 5 columns]"
+      ]
+     },
+     "execution_count": 21,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# How to set the number of rows to be visualized\n",
+    "pd.set_option('max_rows',8)\n",
+    "\n",
+    "# How to visualize all DataFrame\n",
+    "orders"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas\n",
+    "Now use the Pandas `DataFrame.info()` method to see a bit more detail"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "<class 'pandas.core.frame.DataFrame'>\n",
+      "RangeIndex: 4622 entries, 0 to 4621\n",
+      "Data columns (total 5 columns):\n",
+      "order_id              4622 non-null int64\n",
+      "quantity              4622 non-null int64\n",
+      "item_name             4622 non-null object\n",
+      "choice_description    3376 non-null object\n",
+      "item_price            4622 non-null object\n",
+      "dtypes: int64(2), object(3)\n",
+      "memory usage: 180.6+ KB\n"
+     ]
+    }
+   ],
+   "source": [
+    "# How to get infomations on a DataFrame\n",
+    "orders.info()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "We get the name of each column, the Numpy dtype of each column, how many real values are present and the amount of memory used\n",
+    "\n",
+    "*side note: Pandas has excellent support for not-a-number (NaN) entries in DataFrames and Series.*"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas\n",
+    "In Pandas we can very easily perform many types of statistical operations"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>order_id</th>\n",
+       "      <th>quantity</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>count</th>\n",
+       "      <td>4622.000000</td>\n",
+       "      <td>4622.000000</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>mean</th>\n",
+       "      <td>927.254868</td>\n",
+       "      <td>1.075725</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>std</th>\n",
+       "      <td>528.890796</td>\n",
+       "      <td>0.410186</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>min</th>\n",
+       "      <td>1.000000</td>\n",
+       "      <td>1.000000</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>25%</th>\n",
+       "      <td>477.250000</td>\n",
+       "      <td>1.000000</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>50%</th>\n",
+       "      <td>926.000000</td>\n",
+       "      <td>1.000000</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>75%</th>\n",
+       "      <td>1393.000000</td>\n",
+       "      <td>1.000000</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>max</th>\n",
+       "      <td>1834.000000</td>\n",
+       "      <td>15.000000</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "          order_id     quantity\n",
+       "count  4622.000000  4622.000000\n",
+       "mean    927.254868     1.075725\n",
+       "std     528.890796     0.410186\n",
+       "min       1.000000     1.000000\n",
+       "25%     477.250000     1.000000\n",
+       "50%     926.000000     1.000000\n",
+       "75%    1393.000000     1.000000\n",
+       "max    1834.000000    15.000000"
+      ]
+     },
+     "execution_count": 22,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# How to calculate summary statistics of a DataFrame\n",
+    "orders.describe()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "Index(['order_id', 'quantity', 'item_name', 'choice_description',\n",
+       "       'item_price'],\n",
+       "      dtype='object')"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# Get columns of orders DataFrame\n",
+    "orders.columns"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "0          1\n",
+       "1          1\n",
+       "2          1\n",
+       "3          1\n",
+       "        ... \n",
+       "4618    1833\n",
+       "4619    1834\n",
+       "4620    1834\n",
+       "4621    1834\n",
+       "Name: order_id, Length: 4622, dtype: int64"
+      ]
+     },
+     "execution_count": 25,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# Each column name is an attribute of a DataFrame\n",
+    "orders.order_id"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "pandas.core.series.Series"
+      ]
+     },
+     "execution_count": 27,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "type(orders.order_id)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "source": [
+    "- A **Pandas Series** is a single vector of data (like a `numpy` array), with an index that labels each element in the vector\n",
+    "- It supports both integer-based and label-based indexing"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# Make a Series\n",
+    "S = pd.Series([632, 1638, 569, 115])\n",
+    "S"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([ 632, 1638,  569,  115])"
+      ]
+     },
+     "execution_count": 29,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# How to get the values of a series\n",
+    "S.values"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "RangeIndex(start=0, stop=4, step=1)"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# How to get the index of a series\n",
+    "S.index"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "- A `numpy` array contains the values of the series\n",
+    "- If an index is not specified, the natural sequence of integers is assigned as index\n",
+    "- The index of a series is a `pandas` index object "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "<class 'pandas.core.frame.DataFrame'>\n",
+      "RangeIndex: 71436 entries, 0 to 71435\n",
+      "Data columns (total 3 columns):\n",
+      "Elevation    71436 non-null int64\n",
+      "Aspect       71436 non-null int64\n",
+      "Slope        71436 non-null int64\n",
+      "dtypes: int64(3)\n",
+      "memory usage: 1.6 MB\n"
+     ]
+    }
+   ],
+   "source": [
+    "# How to read a DataFrame from the first 3 columns of a .csv.gz file\n",
+    "A = pd.read_csv('num.csv.gz', header=None, \\\n",
+    "    names=['Elevation', 'Aspect', 'Slope'], usecols=range(0, 3))\n",
+    "A.info()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>Elevation</th>\n",
+       "      <th>Aspect</th>\n",
+       "      <th>Slope</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>153</th>\n",
+       "      <td>2687</td>\n",
+       "      <td>20</td>\n",
+       "      <td>11</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>692</th>\n",
+       "      <td>2890</td>\n",
+       "      <td>20</td>\n",
+       "      <td>16</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1075</th>\n",
+       "      <td>3020</td>\n",
+       "      <td>20</td>\n",
+       "      <td>18</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1477</th>\n",
+       "      <td>3133</td>\n",
+       "      <td>20</td>\n",
+       "      <td>29</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>...</th>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>70276</th>\n",
+       "      <td>2761</td>\n",
+       "      <td>20</td>\n",
+       "      <td>9</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>70377</th>\n",
+       "      <td>3044</td>\n",
+       "      <td>20</td>\n",
+       "      <td>7</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>70458</th>\n",
+       "      <td>2995</td>\n",
+       "      <td>20</td>\n",
+       "      <td>7</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>70912</th>\n",
+       "      <td>2774</td>\n",
+       "      <td>20</td>\n",
+       "      <td>22</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "<p>270 rows × 3 columns</p>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "       Elevation  Aspect  Slope\n",
+       "153         2687      20     11\n",
+       "692         2890      20     16\n",
+       "1075        3020      20     18\n",
+       "1477        3133      20     29\n",
+       "...          ...     ...    ...\n",
+       "70276       2761      20      9\n",
+       "70377       3044      20      7\n",
+       "70458       2995      20      7\n",
+       "70912       2774      20     22\n",
+       "\n",
+       "[270 rows x 3 columns]"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# Filter rows, based on column values\n",
+    "A[A['Aspect'] == 20]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {
+    "scrolled": true,
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th>Slope</th>\n",
+       "      <th>Aspect</th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th>1820</th>\n",
+       "      <td>17</td>\n",
+       "      <td>344</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1825</th>\n",
+       "      <td>17</td>\n",
+       "      <td>50</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>1890</th>\n",
+       "      <td>17</td>\n",
+       "      <td>262</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>2234</th>\n",
+       "      <td>17</td>\n",
+       "      <td>37</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>...</th>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>13327</th>\n",
+       "      <td>17</td>\n",
+       "      <td>84</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>13460</th>\n",
+       "      <td>17</td>\n",
+       "      <td>48</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>13555</th>\n",
+       "      <td>17</td>\n",
+       "      <td>287</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>15007</th>\n",
+       "      <td>17</td>\n",
+       "      <td>107</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "<p>146 rows × 2 columns</p>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "       Slope  Aspect\n",
+       "1820      17     344\n",
+       "1825      17      50\n",
+       "1890      17     262\n",
+       "2234      17      37\n",
+       "...      ...     ...\n",
+       "13327     17      84\n",
+       "13460     17      48\n",
+       "13555     17     287\n",
+       "15007     17     107\n",
+       "\n",
+       "[146 rows x 2 columns]"
+      ]
+     },
+     "execution_count": 31,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# use multiple conditions\n",
+    "condition = (A.Elevation < 2400) & (A.Slope == 17)\n",
+    "cols = ['Slope', 'Aspect']\n",
+    "A[condition][cols]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# Use a different example dataset\n",
+    "baseball = pd.read_csv(\"https://raw.githubusercontent.com/fonnesbeck/statistical-analysis-python-tutorial/master/data/baseball.csv\", index_col='id')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 33,
+   "metadata": {
+    "scrolled": false,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div>\n",
+       "<style scoped>\n",
+       "    .dataframe tbody tr th:only-of-type {\n",
+       "        vertical-align: middle;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe tbody tr th {\n",
+       "        vertical-align: top;\n",
+       "    }\n",
+       "\n",
+       "    .dataframe thead th {\n",
+       "        text-align: right;\n",
+       "    }\n",
+       "</style>\n",
+       "<table border=\"1\" class=\"dataframe\">\n",
+       "  <thead>\n",
+       "    <tr style=\"text-align: right;\">\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th>stint</th>\n",
+       "      <th>lg</th>\n",
+       "      <th>g</th>\n",
+       "      <th>ab</th>\n",
+       "      <th>r</th>\n",
+       "      <th>h</th>\n",
+       "      <th>X2b</th>\n",
+       "      <th>X3b</th>\n",
+       "      <th>hr</th>\n",
+       "      <th>rbi</th>\n",
+       "      <th>sb</th>\n",
+       "      <th>cs</th>\n",
+       "      <th>bb</th>\n",
+       "      <th>so</th>\n",
+       "      <th>ibb</th>\n",
+       "      <th>hbp</th>\n",
+       "      <th>sh</th>\n",
+       "      <th>sf</th>\n",
+       "      <th>gidp</th>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>year</th>\n",
+       "      <th>team</th>\n",
+       "      <th>player</th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "      <th></th>\n",
+       "    </tr>\n",
+       "  </thead>\n",
+       "  <tbody>\n",
+       "    <tr>\n",
+       "      <th rowspan=\"7\" valign=\"top\">2006</th>\n",
+       "      <th>CHN</th>\n",
+       "      <th>womacto01</th>\n",
+       "      <td>2</td>\n",
+       "      <td>NL</td>\n",
+       "      <td>19</td>\n",
+       "      <td>50</td>\n",
+       "      <td>6</td>\n",
+       "      <td>14</td>\n",
+       "      <td>1</td>\n",
+       "      <td>0</td>\n",
+       "      <td>1</td>\n",
+       "      <td>2.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>4</td>\n",
+       "      <td>4.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>3.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>BOS</th>\n",
+       "      <th>schilcu01</th>\n",
+       "      <td>1</td>\n",
+       "      <td>AL</td>\n",
+       "      <td>31</td>\n",
+       "      <td>2</td>\n",
+       "      <td>0</td>\n",
+       "      <td>1</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>NYA</th>\n",
+       "      <th>myersmi01</th>\n",
+       "      <td>1</td>\n",
+       "      <td>AL</td>\n",
+       "      <td>62</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>MIL</th>\n",
+       "      <th>helliri01</th>\n",
+       "      <td>1</td>\n",
+       "      <td>NL</td>\n",
+       "      <td>20</td>\n",
+       "      <td>3</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>2.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>...</th>\n",
+       "      <th>...</th>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "      <td>...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>ARI</th>\n",
+       "      <th>gonzalu01</th>\n",
+       "      <td>1</td>\n",
+       "      <td>NL</td>\n",
+       "      <td>153</td>\n",
+       "      <td>586</td>\n",
+       "      <td>93</td>\n",
+       "      <td>159</td>\n",
+       "      <td>52</td>\n",
+       "      <td>2</td>\n",
+       "      <td>15</td>\n",
+       "      <td>73.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>69</td>\n",
+       "      <td>58.0</td>\n",
+       "      <td>10.0</td>\n",
+       "      <td>7.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>6.0</td>\n",
+       "      <td>14.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>LAN</th>\n",
+       "      <th>seleaa01</th>\n",
+       "      <td>1</td>\n",
+       "      <td>NL</td>\n",
+       "      <td>28</td>\n",
+       "      <td>26</td>\n",
+       "      <td>2</td>\n",
+       "      <td>5</td>\n",
+       "      <td>1</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>1</td>\n",
+       "      <td>7.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>6.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>1.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th rowspan=\"2\" valign=\"top\">2007</th>\n",
+       "      <th>ATL</th>\n",
+       "      <th>francju01</th>\n",
+       "      <td>2</td>\n",
+       "      <td>NL</td>\n",
+       "      <td>15</td>\n",
+       "      <td>40</td>\n",
+       "      <td>1</td>\n",
+       "      <td>10</td>\n",
+       "      <td>3</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>8.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>4</td>\n",
+       "      <td>10.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>1.0</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>NYN</th>\n",
+       "      <th>francju01</th>\n",
+       "      <td>1</td>\n",
+       "      <td>NL</td>\n",
+       "      <td>40</td>\n",
+       "      <td>50</td>\n",
+       "      <td>7</td>\n",
+       "      <td>10</td>\n",
+       "      <td>0</td>\n",
+       "      <td>0</td>\n",
+       "      <td>1</td>\n",
+       "      <td>8.0</td>\n",
+       "      <td>2.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>10</td>\n",
+       "      <td>13.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>0.0</td>\n",
+       "      <td>1.0</td>\n",
+       "      <td>1.0</td>\n",
+       "    </tr>\n",
+       "  </tbody>\n",
+       "</table>\n",
+       "<p>10 rows × 19 columns</p>\n",
+       "</div>"
+      ],
+      "text/plain": [
+       "                     stint  lg    g   ab   r    h  X2b  X3b  hr   rbi   sb  \\\n",
+       "year team player                                                             \n",
+       "2006 CHN  womacto01      2  NL   19   50   6   14    1    0   1   2.0  1.0   \n",
+       "     BOS  schilcu01      1  AL   31    2   0    1    0    0   0   0.0  0.0   \n",
+       "     NYA  myersmi01      1  AL   62    0   0    0    0    0   0   0.0  0.0   \n",
+       "     MIL  helliri01      1  NL   20    3   0    0    0    0   0   0.0  0.0   \n",
+       "...                    ...  ..  ...  ...  ..  ...  ...  ...  ..   ...  ...   \n",
+       "     ARI  gonzalu01      1  NL  153  586  93  159   52    2  15  73.0  0.0   \n",
+       "     LAN  seleaa01       1  NL   28   26   2    5    1    0   0   0.0  0.0   \n",
+       "2007 ATL  francju01      2  NL   15   40   1   10    3    0   0   8.0  0.0   \n",
+       "     NYN  francju01      1  NL   40   50   7   10    0    0   1   8.0  2.0   \n",
+       "\n",
+       "                      cs  bb    so   ibb  hbp   sh   sf  gidp  \n",
+       "year team player                                               \n",
+       "2006 CHN  womacto01  1.0   4   4.0   0.0  0.0  3.0  0.0   0.0  \n",
+       "     BOS  schilcu01  0.0   0   1.0   0.0  0.0  0.0  0.0   0.0  \n",
+       "     NYA  myersmi01  0.0   0   0.0   0.0  0.0  0.0  0.0   0.0  \n",
+       "     MIL  helliri01  0.0   0   2.0   0.0  0.0  0.0  0.0   0.0  \n",
+       "...                  ...  ..   ...   ...  ...  ...  ...   ...  \n",
+       "     ARI  gonzalu01  1.0  69  58.0  10.0  7.0  0.0  6.0  14.0  \n",
+       "     LAN  seleaa01   0.0   1   7.0   0.0  0.0  6.0  0.0   1.0  \n",
+       "2007 ATL  francju01  0.0   4  10.0   1.0  0.0  0.0  1.0   1.0  \n",
+       "     NYN  francju01  1.0  10  13.0   0.0  0.0  0.0  1.0   1.0  \n",
+       "\n",
+       "[10 rows x 19 columns]"
+      ]
+     },
+     "execution_count": 33,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# Multiple index\n",
+    "baseball_h = baseball.set_index(['year', 'team', 'player'])\n",
+    "baseball_h.head(10)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 35,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# Our xls file\n",
+    "xlsfile = 'output.xlsx'\n",
+    "\n",
+    "# how to write on a xls file from A DataFrame\n",
+    "A[:2500].to_excel(xlsfile,'Sheet1')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 36,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "# Our json file\n",
+    "jsonfile = 'mydata.json'## read data from a SQL db\n",
+    "\n",
+    "# Save the first 5 rows\n",
+    "A.loc[:5].to_json(jsonfile)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## pandas\n",
+    "\n",
+    "```python\n",
+    "# read db table in 3 lines\n",
+    "from sqlalchemy import create_engine\n",
+    "con = create_engine('postgresql://user@hostname:port/database')\n",
+    "df = pd.read_sql_table('mytable', con)\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## that's all folks!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 38,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "application/json": {
+       "Software versions": [
+        {
+         "module": "Python",
+         "version": "3.6.4+ 64bit [GCC 7.3.0]"
+        },
+        {
+         "module": "IPython",
+         "version": "6.2.1"
+        },
+        {
+         "module": "OS",
+         "version": "Linux 4.14.0 3 amd64 x86_64 with debian buster sid"
+        },
+        {
+         "module": "numpy",
+         "version": "1.14.2"
+        },
+        {
+         "module": "scipy",
+         "version": "1.0.1"
+        },
+        {
+         "module": "matplotlib",
+         "version": "2.2.2"
+        },
+        {
+         "module": "pandas",
+         "version": "0.22.0"
+        }
+       ]
+      },
+      "text/html": [
+       "<table><tr><th>Software</th><th>Version</th></tr><tr><td>Python</td><td>3.6.4+ 64bit [GCC 7.3.0]</td></tr><tr><td>IPython</td><td>6.2.1</td></tr><tr><td>OS</td><td>Linux 4.14.0 3 amd64 x86_64 with debian buster sid</td></tr><tr><td>numpy</td><td>1.14.2</td></tr><tr><td>scipy</td><td>1.0.1</td></tr><tr><td>matplotlib</td><td>2.2.2</td></tr><tr><td>pandas</td><td>0.22.0</td></tr><tr><td colspan='2'>Thu Mar 29 16:17:47 2018 CEST</td></tr></table>"
+      ],
+      "text/latex": [
+       "\\begin{tabular}{|l|l|}\\hline\n",
+       "{\\bf Software} & {\\bf Version} \\\\ \\hline\\hline\n",
+       "Python & 3.6.4+ 64bit [GCC 7.3.0] \\\\ \\hline\n",
+       "IPython & 6.2.1 \\\\ \\hline\n",
+       "OS & Linux 4.14.0 3 amd64 x86\\_64 with debian buster sid \\\\ \\hline\n",
+       "numpy & 1.14.2 \\\\ \\hline\n",
+       "scipy & 1.0.1 \\\\ \\hline\n",
+       "matplotlib & 2.2.2 \\\\ \\hline\n",
+       "pandas & 0.22.0 \\\\ \\hline\n",
+       "\\hline \\multicolumn{2}{|l|}{Thu Mar 29 16:17:47 2018 CEST} \\\\ \\hline\n",
+       "\\end{tabular}\n"
+      ],
+      "text/plain": [
+       "Software versions\n",
+       "Python 3.6.4+ 64bit [GCC 7.3.0]\n",
+       "IPython 6.2.1\n",
+       "OS Linux 4.14.0 3 amd64 x86_64 with debian buster sid\n",
+       "numpy 1.14.2\n",
+       "scipy 1.0.1\n",
+       "matplotlib 2.2.2\n",
+       "pandas 0.22.0\n",
+       "Thu Mar 29 16:17:47 2018 CEST"
+      ]
+     },
+     "execution_count": 38,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# Versions\n",
+    "\n",
+    "%reload_ext version_information\n",
+    "\n",
+    "%version_information numpy, scipy, matplotlib, pandas"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "import antigravity"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/12-Classes.ipynb b/12-Classes.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..6475e58821336303d639c7db4027ad845e58fb65
--- /dev/null
+++ b/12-Classes.ipynb
@@ -0,0 +1,537 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# classes (short introduction)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## class\n",
+    "The classes are the means to define new types. Imagine to not have type complex:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "class Complex(object):\n",
+    "    def __init__(self, r=0.0, i=0.0):\n",
+    "        self.re = r\n",
+    "        self.im = i\n",
+    "    def __mul__(self, other):\n",
+    "        return Complex(self.re*other.re-self.im*other.im, \n",
+    "                       self.re*other.im+self.im*other.re)\n",
+    "    def __imul__(self, other):\n",
+    "        self.re = self.re*other.re-self.im*other.im\n",
+    "        self.im = self.re*other.im+self.im*other.re\n",
+    "        return self\n",
+    "    def __rmul__(self, other):\n",
+    "        return self.__mul__(other)\n",
+    "    def __str__(self):\n",
+    "        return \"({0}+{1}j)\".format(self.re, self.im)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "(2+3j)\n"
+     ]
+    }
+   ],
+   "source": [
+    "ci = Complex(r=2, i=3)\n",
+    "print(ci)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## instances\n",
+    "We said that everything is an object. Now we can say that an object is an instance of a class. \n",
+    "\n",
+    "4 is an instance of the class `int`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## methods\n",
+    "Classes have methods or functions that can be attached to instances of that class.\n",
+    "\n",
+    "The first argument to any method is the instance on which it applies; conventionally it is called self."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "A:f 10\n"
+     ]
+    }
+   ],
+   "source": [
+    "class A(object):\n",
+    "   def f(self, i):\n",
+    "       print(\"A:f\", i)\n",
+    "\n",
+    "a = A()\n",
+    "a.f(10)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## attributes\n",
+    "Each instance (each object) can have attributes. They can be added at any time:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "AttributeError",
+     "evalue": "'A' object has no attribute 'x'",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-4-e27186f28a17>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mAttributeError\u001b[0m: 'A' object has no attribute 'x'"
+     ]
+    }
+   ],
+   "source": [
+    "a.x"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "a.x = 10.2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10.2"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a.x"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## attributes\n",
+    "Normally however the attributes should be defined only by the methods of the class. In particular, through the `__init__` method, the class constructor, which is called when an instance of a class is being built.\n",
+    "\n",
+    "```python\n",
+    "class Complex(object):  \n",
+    "    def __init__(self, r=0.0, i=0.0):\n",
+    "        self.re = r  # add attribute 're' to self\n",
+    "        self.im = i  # add attribute 'im' to self\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## attributes\n",
+    "In other words, the attributes of an instance of a certain class should be defined within the class, and in particular in the `__init__` method, and not outside.\n",
+    "\n",
+    "But this is a style rule, not a syntax rule."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## special attributes\n",
+    "\n",
+    "All classes have the attribute `__init__`, because instances must be able to be built. Similarly, there \n",
+    "will be a `__del__`, the destructor, called automatically when the object should be destroyed.\n",
+    "\n",
+    "For various functionality there are methods with special name, for example: `__len__, __str__, __repr__, __sort__, __get__, __setitem__, __delitem__, __add__, __iadd__, __radd__, __contains__, ...`"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## class attributes\n",
+    "\n",
+    "Classes themselves may have attributes. The methods are attributes of the class, type function."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "class ALFA(object):\n",
+    "    A = 10 # class attribute\n",
+    "    def __init__(self):\n",
+    "        self.x = 3"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = ALFA()\n",
+    "a.A"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a.x"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a.__class__.A"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "ALFA.A"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## inheritance\n",
+    "A class can inherit from another class; in such case, it inherits all the contents, including methods. The methods can be redefined."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "class BETA(ALFA):\n",
+    "    def __init__(self):\n",
+    "        ALFA.__init__(self) # call superclass constructor\n",
+    "        self.y = 5"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "10"
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b = BETA()\n",
+    "b.A"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 14,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b.x"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "5"
+      ]
+     },
+     "execution_count": 15,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b.y"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## inheritance\n",
+    "super() function lets you delegate to a base classan operation:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "class BETA(ALFA):\n",
+    "    def __init__(self):\n",
+    "        super().__init__()  # => ALFA.__init__(self)\n",
+    "        self.y = 5"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/13-Iterables-Generators-Iterators.ipynb b/13-Iterables-Generators-Iterators.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..018b3fc1c8710fd9eac4b46ef22268067494b60a
--- /dev/null
+++ b/13-Iterables-Generators-Iterators.ipynb
@@ -0,0 +1,1216 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## iterables  \n",
+    "\n",
+    "We have seen various containers; all these are iterables, namely, it is possible to iterate through the elements of these objects (for example, with a loop).\n",
+    "\n",
+    "There are other objects on which it is possible to iterate, although strictly speaking not contain anything.\n",
+    "\n",
+    "We have seen some examples of iterables that have no content: `range, filter, map`..."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterables\n",
+    "We define a function similar to the range, but that creates and returns a list (unlike range, it starts from 1 and stop is included):"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def up_to(N):\n",
+    "    \"\"\"Returns the list of integers 1...N\n",
+    "       >>> up_to(3)\n",
+    "       [1, 2, 3]\"\"\"\n",
+    "    l = []\n",
+    "    i = 1\n",
+    "    while i < N + 1:\n",
+    "        l.append(i)\n",
+    "        i += 1\n",
+    "    return l"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterables\n",
+    "Now consider the function sumn that sum the first N integers, using our function `up_to`:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def sumn(N):\n",
+    "    \"\"\"Returns the sum of the first N integers. N is included.\"\"\"\n",
+    "    s = 0\n",
+    "    for i in up_to(N):\n",
+    "        s += i\n",
+    "    return s"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "55"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "sumn(10)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "50005000"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "sumn(10000)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterables\n",
+    "This is inefficient, because it creates a list of N elements, although it is always used one at a time. \n",
+    "\n",
+    "To add all the elements 1 to N is enough for me \"generate\" one after the other: there is no need to have them all at the same time in memory!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterables"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def up_to_iter(N):\n",
+    "    \"\"\"Generates all the integers 1...N\n",
+    "       >>> list(up_to_iter(3))\n",
+    "       [1, 2, 3]\"\"\"\n",
+    "    i = 1\n",
+    "    while i < N + 1:\n",
+    "        yield i\n",
+    "        i += 1"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterables\n",
+    "Let's use `up_to_iter()` function just created"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def sumn2(N):\n",
+    "    \"\"\"sumn(N) -> sum of the integers 1...N\"\"\"\n",
+    "    s = 0\n",
+    "    for i in up_to_iter(N):\n",
+    "        s += i\n",
+    "    return s"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "55"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "sumn2(10)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## generators and iterators\n",
+    "The function up_to_iter is a generator. It produces an iterable. The trick is to replace `return` with `yield`; both \"return\" to the caller expression at the right.\n",
+    "\n",
+    "The difference is that when yield is called, the function \"remains on the stack\", and its execution can be resumed from where it left off.\n",
+    "\n",
+    "The constructs for flow control (for, list comprehension, ...) do it automatically.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## generators ed iterators\n",
+    "\n",
+    "To be more accurate, the iteration involves two types of objects, usually separated:\n",
+    "\n",
+    "* __the iterable object__: is the sequence, the object that can be used for example directly in a for;\n",
+    "* __the iterator__ is the object that enables the iteration on a particular iterable object.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterable object\n",
+    "An iterable object is any object that implements the method `__iter__()`; when called, this method returns an iterator for the object."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterator\n",
+    "An iterator is any object that implements the method `__next__()`; when called, this method returns the next iteration element.\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "1\n",
+      "2\n",
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "lst = [1, 2, 3]\n",
+    "for i in lst:\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "1\n",
+      "2\n",
+      "3\n"
+     ]
+    },
+    {
+     "ename": "StopIteration",
+     "evalue": "",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mStopIteration\u001b[0m                             Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-9-521c4951927b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0miterator\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0miter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlst\u001b[0m\u001b[0;34m)\u001b[0m   \u001b[0;31m# -> lst.__iter__()\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m     \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0miterator\u001b[0m\u001b[0;34m)\u001b[0m  \u001b[0;31m# -> iterator.__next__()\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[0mi\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+      "\u001b[0;31mStopIteration\u001b[0m: "
+     ]
+    }
+   ],
+   "source": [
+    "lst = [1, 2, 3]\n",
+    "iterator = iter(lst)   # -> lst.__iter__()\n",
+    "while True:\n",
+    "    i = next(iterator)  # -> iterator.__next__()\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## iterators\n",
+    "If you know a bit of __object-oriented__ programming, it is not difficult to build an iterator in python; in general, it is an object that should simply keep some state between a call and the other of the method `__next__()` (must \"remember\" the last value product, and generate the next).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## why two classes and not one?\n",
+    "Why an iterable object delegate the iteration to a second object? Why it does not implement the method `__next__()` itself? After all, it has all the information to do so."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "lst = [1, 2, 3]\n",
+    "hasattr(lst, '__iter__')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "False"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hasattr(lst, '__next__')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 12,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "hasattr(iter(lst), '__next__')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## why two classes and not one?\n",
+    "The reason is that the iterator must maintain a state (must remember at what point is \n",
+    "the process of iteration):\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "Suppose we define a MyList class which implements directly **`__next__()`**\n",
+    "\n",
+    "```python\n",
+    "class MyList(object):\n",
+    "    ...\n",
+    "    def __iter__(self):\n",
+    "        return self\n",
+    "    def __next__(self):\n",
+    "        value = self._values[self._index]\n",
+    "        self._index += 1\n",
+    "        return value\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "```python\n",
+    ">>> mylst = MyList([1, 2, 3])\n",
+    ">>> for i in mylst:\n",
+    "...    print(i)\n",
+    "...\n",
+    "1\n",
+    "2\n",
+    "3\n",
+    ">>>\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "collapsed": true,
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "source": [
+    "```python\n",
+    ">>> for i in mylst:\n",
+    "...    print(i)\n",
+    "...\n",
+    ">>>\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## why two classes and not one?\n",
+    "Even Worse, it would not be possible the nested iteration:\n",
+    "\n",
+    "```python\n",
+    ">>> lst = [1, 2, 3]\n",
+    ">>> for i in lst:\n",
+    "...     for j in lst:\n",
+    "...         print(i, j)\n",
+    "...\n",
+    "1 1\n",
+    "1 2\n",
+    "1 3\n",
+    "2 1\n",
+    "2 2\n",
+    "2 3\n",
+    ">>>\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "```python\n",
+    ">>> mylst = MyList([1, 2, 3])\n",
+    ">>> for i in mylst:\n",
+    "...     for j in mylst:\n",
+    "...         print(i, j)\n",
+    "...\n",
+    "1 2\n",
+    "1 3\n",
+    ">>>\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## generators\n",
+    "A generator is therefore a \"trick\" to avoid manually construct two classes: one for the iterable object, \n",
+    "and one for the `iterator`.\n",
+    "\n",
+    "Defining a simple function that uses the `yield` instead of `return` and you get the purpose.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## infinite sequences\n",
+    "The benefit of iterators is that deliver even infinite sequences, with an insignificant memory allocation:\n",
+    "```python\n",
+    ">>> def even_numbers():\n",
+    "...     i=2\n",
+    "...     while True:\n",
+    "...         yield i\n",
+    "...         i += 2\n",
+    "...    \n",
+    ">>> for n in even_numbers():\n",
+    "...     if not is_sum_of_two_primes(n):\n",
+    "...         print(\"Goldbach was wrong!\")\n",
+    "...         break\n",
+    "...\n",
+    ">>>\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## iteration"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "1"
+      ]
+     },
+     "execution_count": 17,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = [1, 2, 3]\n",
+    "il = iter(l)\n",
+    "next(il) # => l.__next__()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 18,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "next(il) # => l.__next__()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "3"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "next(il) # => l.__next__()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "StopIteration",
+     "evalue": "",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mStopIteration\u001b[0m                             Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-20-6adbb62462de>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mnext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mil\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# => l.__next__()\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mStopIteration\u001b[0m: "
+     ]
+    }
+   ],
+   "source": [
+    "next(il) # => l.__next__()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## python2\n",
+    "In python2 many functions or methods return lists and not iterators. For example, the methods `keys`, `values`, `items` of the dictionaries return `lists`. \n",
+    "\n",
+    "However, there are the methods `iterkeys`, `itervalues`, `iteritems` that return `iterators`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "## iterator\n",
+    "The concept of iterator is a typical example of design pattern, that is an efficient and diffused solution to a general problem.\n",
+    "\n",
+    "In python the concept is pervasive: everything that scrolls over an object from left to right does it through iterators.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## built-in functions that operate on iterators\n",
+    "There are many built-in functions that operate on iterables, for example container constructors:\n",
+    "* __list (iterable)__: builds a list\n",
+    "* __tuple (iterable)__: builds a tuple\n",
+    "* __dict (iterable)__: builds a dictionary (warning: the elements in `iterable` should be key/value pairs, that is tuples of two elements)\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## built-in generators\n",
+    "\n",
+    "There are many useful built-in generators:\n",
+    "* `range([start,] stop[, incr])`: generates a sequence\n",
+    "* `zip(it1, it2)`: generates a sequence of pairs whoselements are taken from it1 and it2\n",
+    "* `enumerate(it)`: generates a sequence of pairs (i, e) where e is an element of it, and i its index.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## built-in generators"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "l1 = ['a', 'b', 'c']\n",
+    "l2 = [1, 2, 3]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "a=1\n",
+      "b=2\n",
+      "c=3\n"
+     ]
+    }
+   ],
+   "source": [
+    "for a, b in zip(l1, l2):\n",
+    "    print(\"{}={}\".format(a, b))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## built-in generators"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "<zip at 0x111566708>"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "zip(l1, l2)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[('a', 1), ('b', 2), ('c', 3)]"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "list(zip(l1, l2))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'a': 1, 'b': 2, 'c': 3}"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dict(zip(l1, l2))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## built-in generators"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "l1 = ['a', 'b', 'c'] "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0 a\n",
+      "1 b\n",
+      "2 c\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i, e in enumerate(l1):\n",
+    "    print(i, e)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "<enumerate at 0x111594c60>"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "enumerate(l1) "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## generator expressions\n",
+    "If you use round brackets instead of square brackets, the same syntax as the list comprehension allows you to define generators on­the­fly:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[0, 1, 8, 27]"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "[i**3 for i in range(4)]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "<generator object <genexpr> at 0x111557eb8>"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(i**3 for i in range(4))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "36"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "sum((i**3 for i in range(4)))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "36"
+      ]
+     },
+     "execution_count": 12,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "sum(i**3 for i in range(4))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## generator expressions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "g = range(1000000)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "333332833333500000"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# list of 1000000 elements!\n",
+    "sum([e**2 for e in g])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "333332833333500000"
+      ]
+     },
+     "execution_count": 20,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "# generator\n",
+    "sum(e**2 for e in g)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (primes.py)\n",
+    "* Write a generator \"primes\" that produces the sequence of prime numbers (all!). The efficiency is not important.\n",
+    "* Using the generator \"primes\", create a list of thefirst 250 prime numbers.\n",
+    "* Using the generator \"primes\", define a function \"`pi(N)`\" that returns the number of prime  numbers less than `N`.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/14-More_introspection.ipynb b/14-More_introspection.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..a4b76928c37978ecbc86cc360aa3d20791c73f57
--- /dev/null
+++ b/14-More_introspection.ipynb
@@ -0,0 +1,620 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# more on introspection"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection\n",
+    "The introspection is the ability of a language to provide various information run-time about the objects.\n",
+    "\n",
+    "Python has an excellent support for introspection, unlike languages such as Fortran or C that have none, or C++, which has a very limited support.\n",
+    "\n",
+    "It is useful for:\n",
+    "* Debugging\n",
+    "* Learn more easily how to use libraries\n",
+    "* Develop certain algorithms\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection\n",
+    "\n",
+    "Determine the type of an object is very easy: just use the `type` command:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "l = [1, \"alfa\", 0.9, (1, 2, 3)]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "[int, str, float, tuple]"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "[type(i) for i in l]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection\n",
+    "Sometimes it is useful in functions, because the type of arguments of a function is not fixed, but it depends on how the function is called. \n",
+    "\n",
+    "The command `isinstance(obj, t)` tells us if the object obj is of type t:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def dupl(a):\n",
+    "    if isinstance(a, list):\n",
+    "        return [dupl(i) for i in a]\n",
+    "    else:\n",
+    "        return 2*a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "20"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dupl(10)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "['aa', 6, [2, 4, 6]]"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "dupl(['a', 3, [1, 2, 3]])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection\n",
+    "The function `dir()` returns a list containing the symbolic names of members of an object (attributes or \n",
+    "methods):"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "<class 'list'>\n",
+      "['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']\n"
+     ]
+    }
+   ],
+   "source": [
+    "l = [3, 4, 1]\n",
+    "print(type(l))\n",
+    "print(dir(l))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "L.sort(key=None, reverse=False) -> None -- stable sort *IN PLACE*\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(l.sort.__doc__)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[4, 3, 1]\n"
+     ]
+    }
+   ],
+   "source": [
+    "l.sort(key=lambda x: -x)\n",
+    "print(l)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection\n",
+    "Often items have “special” attributes that contain useful information for introspection:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "<class 'list'>\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(l.__class__)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "list\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(l.__class__.__name__)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "sort\n"
+     ]
+    }
+   ],
+   "source": [
+    "f = l.sort\n",
+    "print(f.__name__)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## introspection\n",
+    "Sometimes you want to know if an instance has a certain attribute:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "class A(object):\n",
+    "    x = 3\n",
+    "    \n",
+    "a = A()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "if hasattr(a, 'x'):\n",
+    "    print(a.x)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## object structure\n",
+    "To understand how introspection works, it is useful to know how objects are structured."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3 10\n"
+     ]
+    }
+   ],
+   "source": [
+    "class ALFA(object):\n",
+    "    A = 10\n",
+    "    def __init__(self):\n",
+    "        self.x = 3\n",
+    "        \n",
+    "a = ALFA()\n",
+    "print(a.x, a.A)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## object structure\n",
+    "Each object has an attribute `__dict__` containing a dictionary; `__dict__` contains all the attributes of the object, indexed by its name:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(a.__dict__[\"x\"])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "{'__module__': '__main__', 'A': 10, '__init__': <function ALFA.__init__ at 0x109315e18>, '__dict__': <attribute '__dict__' of 'ALFA' objects>, '__weakref__': <attribute '__weakref__' of 'ALFA' objects>, '__doc__': None}\n"
+     ]
+    }
+   ],
+   "source": [
+    "# class attributes\n",
+    "print(ALFA.__dict__)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "fragment"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "{'x': 3}\n"
+     ]
+    }
+   ],
+   "source": [
+    "# instance attributes\n",
+    "print(a.__dict__)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## object structure\n",
+    "When you access an attribute of an object, first it searches in the dictionary of the object, then in the dictionary of his class (and possibly in the dictionary of the base classes):"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "10\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(a.A)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "KeyError",
+     "evalue": "'A'",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-20-29b87db12721>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__dict__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'A'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mKeyError\u001b[0m: 'A'"
+     ]
+    }
+   ],
+   "source": [
+    "print(a.__dict__['A'])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "10\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(a.__class__.__dict__['A'])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (interactive)\n",
+    "Using interpreter in interactive mode, determine how to use the following functions: `ord`, `chr`, `callable`.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/15-Error_handling.ipynb b/15-Error_handling.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..856fd0923d23210b00aa3ae0a4ab96c27dd446d9
--- /dev/null
+++ b/15-Error_handling.ipynb
@@ -0,0 +1,658 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "![](images/title_intro_python.png)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "slide"
+    }
+   },
+   "source": [
+    "# error handling"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "Error handling is a complex problem, which the modern languages face off in a completely different way than the \"old\" ones. \n",
+    "\n",
+    "First, we must be aware of the fact that the place where an error is detected (for example, a library function such as `sqrt`) is not the same place where the error can be \"treated\" (for example, the main program).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "The requirements of a modern system for handling errors are:\n",
+    "* Low or no impact on performance, when no error are generated\n",
+    "* Little invasiveness on code\n",
+    "* You should not have to \"pass\" the error by hand\n",
+    "* It must be possible to manage the error \"partially\" (sometimes you can not completely solve the error at one point, but you can apply only a part of the correction)\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "Suppose you have a stack of function calls like this:\n",
+    "\n",
+    "```\n",
+    "main\n",
+    "  |__compute_matrix        <- here the error ZeroDivisionError can be handled completely\n",
+    "     |__compute_cell       <- here the errot BadStartingPoint can be handled, and the error \n",
+    "        |                     ZeroDivisionError can be handled partially\n",
+    "        |__compute_radix_of_function \n",
+    "           |__ newton             -> here the error BadStartingPoint can be detected\n",
+    "               |__function_C      -> here the error ZeroDivisionError can be detected\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "In Fortran, for example, it is used a variable returned by the function/subroutine to pass any error.\n",
+    "\n",
+    "In this case, the variable containing the error should be passed manually backwards, for example from `function_C`, to `newton`, to `compute_radix_of_function`, to `compute_cell`, to `compute_matrix`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "What are the drawbacks?\n",
+    "\n",
+    "* It is a tedious and boring activity that normally lead to errors\n",
+    "* It makes the code much longer and more complicated\n",
+    "* Adds overhead even without error (there will be some __if__ checking the state variables of the function that generates the error, for example).\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "All modern systems use a different approach. \n",
+    "\n",
+    "Consider the error BadStartingPoint.\n",
+    "\n",
+    "At the point where the error can be identified (newton), an exception of type `BadStartingPoint` is launched. For now, do not worry about what `BadStartingPoint` is: it could be anything, an `int`, a `string`, a `list` etc...\n",
+    "\n",
+    "In python, exceptions are launched with the `raise` command. In `fun_B` it will appear something like:\n",
+    "```python\n",
+    "if ...:\n",
+    "    raise BadStartingPoint()\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "When an exception is launched, the program flow is interrupted, and the stack is automatically \"rolled back”, back to the function that called the one who launched the exception, and back again if necessary, up to a point where the error can be \"treated\". The computation resumes from this point.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "How do you determine who can treat a certain error?\n",
+    "\n",
+    "It's simple: the code block that could handle a `BadStartingPoint` exception is enclosed in a special section; when that exception occurs, it will be executed the associated handling section. The syntax is based on the python `try/except` statement.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "Therefore, in the function where we determined that the error can be treated (compute_cell) it is inserted a `try/except` block:\n",
+    "\n",
+    "<pre>\n",
+    "def compute_cell(matrix, i, j):\n",
+    "    # ...\n",
+    "    try:\n",
+    "        matrix[i][j] += compute_radix_of_function(f, cell, x_0)\n",
+    "    except BadStartingPoint as e:\n",
+    "        print(\"ERR: {0}: {0}\".format(e.__class__.__name__, e))\n",
+    "        X_0 += 0.4\n",
+    "    # ...\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "In the intermediate functions nothing changes: they are not involved from the exception.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "In the case of `ZeroDivisionError`, however, the handling is more complex: `compute_cell` can partially repair the error, but not completely. \n",
+    "\n",
+    "The rest of the work is done by `compute_matrix`.\n",
+    "\n",
+    "In this case, the exception is collected, partially managed and relaunched, with the `raise` command:\n",
+    "\n",
+    "<pre>\n",
+    "# ...\n",
+    "except ZeroDivisionError as e:\n",
+    "    print(\"ERR: ZeroDivisionError: resetting cell\")\n",
+    "    matrix[i][j] = 0.0\n",
+    "    raise\n",
+    "# ...\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "At this point the stack is again rolled back to `compute_matrix`, which completes the error handling.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "Generally, exceptions are defined hierarchically. In our example, there are three types of BadStartingPoint errors:\n",
+    "\n",
+    "* `StationaryStartingPoint`\n",
+    "* `CyclingStartingPoint`\n",
+    "* `SlowlyConvergingStartingPoint`\n",
+    "\n",
+    "`newton` launches all these three errors."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "These three types of error are handled the same way by compute_cell, but it is possible that other functions that call `newton` must treat them differently.\n",
+    "\n",
+    "This is accomplished by creating a class `BadStartingPoint`, and the three classes `StationaryStartingPoint`, `CyclingStartingPoint`, `SlowlyConvergingStartingPoint` that inherit from `BadStartingPoint`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## error handling\n",
+    "\n",
+    "What `BadStartingPoint`, `StationaryStartingPoint`, ... are? They are \"types\" of exceptions, or, more generally, \"types\": like `int`, `str`, ...\n",
+    "\n",
+    "However, they are user-defined types, or `classes`.\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## try/except\n",
+    "\n",
+    "<pre style=\"font-size:70%;\">\n",
+    "try:\n",
+    "    ...\n",
+    "    ...\n",
+    "except Exc0:\n",
+    "    ... # catches exceptions type Exc0\n",
+    "except Exc1 as excInstance:\n",
+    "    ... # catches exceptions type Exc1, \n",
+    "        # and its instance is excInstance\n",
+    "except (Exc2, Exc3):\n",
+    "    ... # catches exceptions type Exc2 o Exc3\n",
+    "except (Exc4, Exc5) as excInstance:\n",
+    "    ... # catches exceptions type Exc2 o Exc3, \n",
+    "        # and their instance is excInstance\n",
+    "except:\n",
+    "    ... # catches any exception\n",
+    "else:\n",
+    "    ... # executed only if no exceptions were captured\n",
+    "finally:\n",
+    "    ... # executed always and anyway\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## else/finally example\n",
+    "\n",
+    "<pre>\n",
+    "try:\n",
+    "    f = open(\"a.txt\", \"r\") # NEVER DO THIS! USE: with open(...)\n",
+    "    do_some_action_on_file(f)\n",
+    "except:\n",
+    "    print(\"ERROR\")\n",
+    "else:\n",
+    "    print(\"OK\")\n",
+    "finally:\n",
+    "    f.close()\n",
+    "</pre>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## standard exceptions\n",
+    "Now we can better understand what happens when there is an error in a program:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "ZeroDivisionError",
+     "evalue": "division by zero",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mZeroDivisionError\u001b[0m                         Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-1-a8fd08e7d073>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
+     ]
+    }
+   ],
+   "source": [
+    "a = 4/0"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## standard exceptions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "IndexError",
+     "evalue": "list index out of range",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mIndexError\u001b[0m                                Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-2-52ff604b2b94>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0ml\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ml\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mIndexError\u001b[0m: list index out of range"
+     ]
+    }
+   ],
+   "source": [
+    "l = [1, 2, 3]\n",
+    "print(l[10])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## standard exceptions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "ValueError",
+     "evalue": "list.remove(x): x not in list",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-3-51b8b8a7aebb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ml\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mremove\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m444\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mValueError\u001b[0m: list.remove(x): x not in list"
+     ]
+    }
+   ],
+   "source": [
+    "l.remove(444)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "KeyError",
+     "evalue": "'alfa'",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-4-9f1ad2efe7e6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0md\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[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0md\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'alfa'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mKeyError\u001b[0m: 'alfa'"
+     ]
+    }
+   ],
+   "source": [
+    "d = {}\n",
+    "print(d['alfa']) "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## standard exceptions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "1"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "l = [1, 2]\n",
+    "il = iter(l)\n",
+    "next(il) "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "2"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "next(il)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "ename": "StopIteration",
+     "evalue": "",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[0;31mStopIteration\u001b[0m                             Traceback (most recent call last)",
+      "\u001b[0;32m<ipython-input-7-794757028666>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mnext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mil\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+      "\u001b[0;31mStopIteration\u001b[0m: "
+     ]
+    }
+   ],
+   "source": [
+    "next(il)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## standard exceptions\n",
+    "We now know that a for loop ends when the iterator on which it operates launches an exception StopIterator!"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [],
+   "source": [
+    "def rangeIter(n):\n",
+    "    i = 0\n",
+    "    while True:\n",
+    "        if i >= n: raise StopIteration\n",
+    "        yield i\n",
+    "        i += 1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {
+    "slideshow": {
+     "slide_type": "-"
+    }
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n"
+     ]
+    },
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/Users/nicola/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:1: DeprecationWarning: generator 'rangeIter' raised StopIteration\n",
+      "  \"\"\"Entry point for launching an IPython kernel.\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in rangeIter(3):\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {
+    "slideshow": {
+     "slide_type": "subslide"
+    }
+   },
+   "source": [
+    "## test (primes.py)\n",
+    "* Change the function `is_prime` to generate an error if the argument is not an integer, or if it is a negative integer.\n",
+    "* Write a test program with error handling.\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "celltoolbar": "Slideshow",
+  "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.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/README.md b/README.md
index 32c1ca8e9c9299ba92f602c974f6bc3f4b74d9d2..6ca61e6abc7a6045a285461819af33bd5fc6e123 100644
--- a/README.md
+++ b/README.md
@@ -5,76 +5,88 @@
 ```
 git clone https://gitlab.hpc.cineca.it/nspalla1/intro-python.git
 cd intro-python
-git checkout tags/Cineca_BO201805
 ```
 
 ## Index:
 
-### [Outlook](http://nbviewer.jupyter.org/urls/gitlab.hpc.cineca.it/nspalla1/intro-python/raw/master/00-Outlook.ipynb)
-
-### [01-Introduction_to_Python.ipynb](http://nbviewer.jupyter.org/urls/gitlab.hpc.cineca.it/nspalla1/intro-python/raw/master/01-Introduction_to_Python.ipynb)
+### 01 Introduction
 
 - Philosophy
 - Environment
 - Interpreter
-- Built-in types and operations
 - Program file
-- Built-in containers
-  - Tuples
-  - Lists
-  - Sets
-  - Dicts
-- Flow control contructs
-  - if-elif-else
-  - For loops
-  - While loops
-  - Comparison and logical operators
-    - Object reference
-
-### [02-Introduction_to_Python.ipynb](http://nbviewer.jupyter.org/urls/gitlab.hpc.cineca.it/nspalla1/intro-python/raw/master/02-Introduction_to_Python.ipynb)
-
-- File I/O
-- Functions
-  - Argument Passing
-  - Doc string
-  - Lambda functions
-- Introspection
-- Functional programming
-  - sort
-  - lambda functions
-  - filter, map
-- String formatting
-  - Old and new style
-- Modules
-  - Packages
-  - Program arguments
-
-### [03-Introduction_to_Python.ipynb](http://nbviewer.jupyter.org/urls/gitlab.hpc.cineca.it/nspalla1/intro-python/raw/master/03-Introduction_to_Python.ipynb)
-
-- Standard Library (quick overview)
-  - os, os.path, shutil
-  - glob
-  - sys
-  - argparse
-  - re
-  - math, random
-  - datetime
-  - logging
-  - gzip, csv, json
-  - sqlite3
-  - subprocess
-- Scientific Modules (very quick introduction)
-  - Numpy
-  - Matplotlib
-  - Scipy
-  - Pandas
-
-### [04-Introduction_to_Python.ipynb (EXTRA)](http://nbviewer.jupyter.org/urls/gitlab.hpc.cineca.it/nspalla1/intro-python/raw/master/04-Introduction_to_Python.ipynb)
-
-- Classes (short introduction)
-  - Instances
-  - Methods
-  - Attributes
-  - Inheritance
-- Iterables and Iterators
-- Error handling
+
+### 02 Built-in types and operations
+
+### 03 Built-in containers
+
+- Tuples
+- Lists
+- Sets
+- Dicts
+
+### 04 Flow control contructs
+
+- if-elif-else
+- For loops
+- While loops
+- Comparison and logical operators
+  - Object reference
+
+### 05 File I/O
+
+- Program arguments
+
+### 06 Functions
+
+- Argument Passing
+- Doc string
+- Lambda functions
+
+### 07 Introspection and Functional programming
+
+- sort
+- lambda functions
+- filter, map
+
+### 08 String formatting
+
+- Old and new style
+  
+### 09 Modules
+
+- Packages
+
+### 10 Standard Library (quick overview)
+
+- os, os.path, shutil
+- glob
+- sys
+- argparse
+- re
+- math, random
+- datetime
+- logging
+- gzip, csv, json
+- sqlite3
+- subprocess
+
+### 11 Scientific Modules (very quick introduction)
+
+- Numpy
+- Matplotlib
+- Scipy
+- Pandas
+
+### 12 Classes (short introduction)
+
+- Instances
+- Methods
+- Attributes
+- Inheritance
+
+### 13 Iterables, Generators and Iterators
+
+### 14 More on introspection
+
+### 15 Error handling