diff --git a/01_Fundamentals.ipynb b/01_Fundamentals.ipynb index 338b99ed..deec6b8a 100644 --- a/01_Fundamentals.ipynb +++ b/01_Fundamentals.ipynb @@ -12,7 +12,7 @@ " A module is a file which contains python functions, global variables etc. It is nothing but .py file which has python executable code / statement.\n", "\n", " * Packages:\n", - " A package is namespace which contains multiple package/modules. It is a directory which contains a special file `__init__.py`\n", + " A package is a namespace which contains multiple package/modules. It is a directory which contains a special file `__init__.py`\n", " \n", " * Libraries:\n", " A library is a collection of various packages. There is no difference between package and python library conceptually.\n", @@ -251,7 +251,10 @@ "print (x)\n", "\n", "# Note the difference w.r.t python 2. In python 3 map retuns an iterator so you can do stuff like:\n", - "for i in map(square,range(5)): print(i)" + "for i in map(square,range(5)): print(i)\n", + "\n", + "# or\n", + "[i for i in map(square,range(6))]" ] }, { @@ -260,7 +263,7 @@ "source": [ "### filter\n", "\n", - "The filter function applies a predicate to each memmber of a collection, retaining only those members where the predicate is True" + "The filter function applies a predicate to each member of a collection, retaining only those members where the predicate is True" ] }, { @@ -275,13 +278,20 @@ "print (list(filter(is_even, range(5))))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Combinations in sequence of HOF are obviously possible" + ] + }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "list(map(square, filter(is_even, range(5))))\n" + "list(map(square, filter(is_even, range(5))))" ] }, {