{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "

cs1001.py , Tel Aviv University, Fall 2018

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Recitation 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We discussed the basics of lists, the efficiency of list operations and how to efficiently concatenate a list to another. We also demonstrated list comprehension. \n", "Then, we discussed functions, short circuit evaluation and analyzed the efficiency of the functions we saw.\n", "Finally, we talked about binary numbers (with some theory) and base conversions.\n", "\n", "#### Takeaways:\n", "\n", "
    \n", "
  1. Lists can be a highly modular and useful data structure. Make sure that you understand their functionality and also their limits (figuratively and literally).
  2. \n", "
  3. Avoid using the + operator for extending a given list. Use += or list.extend() instead.\n", "
  4. Functions can be used in one another (max2 in max3_v2) and can be composed together.
  5. \n", "
  6. When analyzing a function's performance, think about the input that will cause the largest amount of work and then measure how many operations the function does.
  7. \n", "
  8. Using short circuit evaluation, if e.g. you have a long \"and\" condition, place the part that is most easy to compute first since if it is false, all other parts of the condition will not be computed.
  9. \n", "
  10. Make sure you understand binary numbers and base conversions (including the algorithms for conversion to and from a base b to decimal). It is a very useful tool in computer science.\n", "
  11. \n", "
\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Code for printing several outputs in one cell (not part of the recitation):" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from IPython.core.interactiveshell import InteractiveShell\n", "InteractiveShell.ast_node_interactivity = \"all\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Lists - Basics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "accessing list items in constant time (given an index)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x = 10\n", "lst = [300, x, \"name\", True, print, [50, 49], 3.14]\n", "len(lst)\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "300" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst[0]\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3.14" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst[len(lst) - 1]\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[300, 10, 'name', True, , [50, 49], 3.14]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "49" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst[-2][1]\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[300, 10, 'name', True, , [50, 490], 3.14]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst[-2][1] = 490\n", "lst\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" }, { "name": "stdout", "output_type": "stream", "text": [ "name\n" ] } ], "source": [ "lst[4]\n", "lst[4](\"name\")\n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" }, { "ename": "IndexError", "evalue": "list index out of range", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mempty_lst\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mempty_lst\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mempty_lst\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mIndexError\u001b[0m: list index out of range" ] } ], "source": [ "#empty list\n", "empty_lst = []\n", "len(empty_lst)\n", "empty_lst[0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "List slicing creates a new list in memory. Slicing takes time that is proportional to the size of the generated slice." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[3, , [3.14, 2.5]]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst = [x, 1, 2, 3, \"name\", print, True, [3.14, 2.5]]\n", "lst[3: 8: 2]\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Operator + generates a new list in memory whose items are items of two concatenated lists" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 3, 10, 20, 30]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "[1, 2, 3]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "[10, 20, 30]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst1 = [1, 2, 3]\n", "lst2 = [10, 20, 30]\n", "\n", "lst_new = lst1 + lst2\n", "lst_new\n", "lst1\n", "lst2\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "How to extend an existing list?" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Bad coding:\n" ] }, { "data": { "text/plain": [ "[1, 2, 3, 10, 20, 30, 10, 20, 30]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" }, { "name": "stdout", "output_type": "stream", "text": [ "Good coding:\n" ] }, { "data": { "text/plain": [ "[1, 2, 3, 10, 20, 30]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "[1, 2, 3, 10, 20, 30, 10]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "[1, 2, 3, 10, 20, 30, 10, [10, 20, 30]]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "[1, 2, 3, 10, 20, 30]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(\"Bad coding:\")\n", "lst1 = lst1 + lst2\n", "lst1\n", "\n", "print(\"Good coding:\")\n", "lst1 = [1, 2, 3]\n", "lst2 = [10, 20, 30]\n", "lst1.extend(lst2)\n", "lst1\n", "lst1.append(10)\n", "lst1\n", "lst1.append(lst2)\n", "lst1\n", "\n", "lst1 = [1, 2, 3]\n", "lst2 = [10, 20, 30]\n", "lst1 += lst2 #invokes extend!!\n", "lst1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Common List functions" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-24.5" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst = [10, -40.5, 6]\n", "sum(lst)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[-40.5, 6, 10]\n", "[10, -40.5, 6]\n", "[-40.5, 6, 10]\n" ] } ], "source": [ "lst = [10, -40.5, 6]\n", "slst = sorted(lst)\n", "print(slst)\n", "print(lst)\n", "\n", "lst.sort()\n", "print(lst)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Iterating over lists" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "Using while loop" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "3\n", "4\n", "hi\n", "bye\n", "100\n" ] } ], "source": [ "lst = [1, 2, 3, 4, \"hi\", \"bye\", 100]\n", "i = 0\n", "while i < len(lst):\n", " print(lst[i])\n", " i += 1" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "Using for loop with range" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "3\n", "4\n", "hi\n", "bye\n", "100\n" ] } ], "source": [ "lst = [1, 2, 3, 4, \"hi\", \"bye\", 100]\n", "for i in range(len(lst)):\n", " print(lst[i])\n", " " ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "Using for loop over elements" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "3\n", "4\n", "hi\n", "bye\n", "100\n" ] } ], "source": [ "lst = [1, 2, 3, 4, \"hi\", \"bye\", 100]\n", "for item in lst:\n", " print(item)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise: given grades, how many are there above average?" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "#### solution 1: using loops" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "How many grades? 5\n", "enter a grade: 89\n", "enter a grade: 34\n", "enter a grade: 84\n", "enter a grade: 56\n", "enter a grade: 100\n", "3 grades are above the average 72.6\n" ] } ], "source": [ "count = int(input(\"How many grades? \"))\n", "above = 0\n", "grades = []\n", "\n", "for i in range(count):\n", " grade = float(input(\"enter a grade: \"))\n", " #grades[i] = grade #WRONG!!\n", " #grades = grades + [grade] #BAD CODING!!\n", " grades.append(grade)\n", " #grades.extend([grade])\n", " #grades += [grade]\n", "\n", "s = sum(grades)\n", "avg = s / count\n", "\n", "for gr in grades:\n", " if gr > avg:\n", " above += 1\n", " \n", "print(above, \"grades are above the average\", avg)\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### list comprehension examples" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 3, 6, 9]" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n", "lst1 = [x for x in lst if x % 3 == 0]\n", "lst1\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 9, 36, 81]" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst2 = [x**2 for x in lst if x % 3 == 0]\n", "lst2\n", "\n" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['!', '!', '!', '!']" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst3 = [\"!\" for x in lst if 2*x > 10]\n", "lst3\n", "\n" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lst4 = [1 for x in lst]\n", "lst4" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Solution 2: using list comprehension" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "count = int(input(\"How many grades? \"))\n", "above = 0\n", "grades = []\n", "\n", "for i in range(count):\n", " grade = float(input(\"enter a grade: \"))\n", " #grades[i] = grade #WRONG!!\n", " #grades = grades + [grade] #BAD CODING!!\n", " grades.append(grade)\n", " #grades.extend([grade])\n", " #grades += [grade]\n", "\n", "s = sum(grades)\n", "avg = s / count\n", "\n", "#for gr in grades:\n", "# if gr > avg:\n", "# above += 1\n", "above = len([1 for gr in grades if gr > avg])\n", "\n", "\n", "print(above, \"grades are above the average\", avg)\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Functions: max2, max3" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "30\n" ] }, { "ename": "TypeError", "evalue": "max2() missing 1 required positional argument: 'b'", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 14\u001b[0m \u001b[0mz\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmax2\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m-\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 15\u001b[1;33m \u001b[0my\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmax2\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mTypeError\u001b[0m: max2() missing 1 required positional argument: 'b'" ] } ], "source": [ "def max2(a, b):\n", " '''\n", " max2(float, float) ---> float\n", " return the maximum od a and b\n", " '''\n", " if a >= b:\n", " return a\n", " #else:\n", " # return b\n", " return b\n", "\n", "x = max2(10, 30)\n", "print(x)\n", "z = max2(x, -4)\n", "y = max2(10)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### max3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### at most 4 comparisons" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def max3_v1(a, b, c):\n", " if a >= b and a >= c:\n", " return a\n", " elif b >= a and b >= c:\n", " return b\n", " else:\n", " return c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### at most 2 comparisons" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def max3_v2(a, b, c):\n", " #max_ab = max2(a, b)\n", " #total_max = max2(max_ab, c)\n", " #return total_max\n", " return max2(max2(a, b), c)\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Short circuit evaluation" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" }, { "ename": "ZeroDivisionError", "evalue": "division by zero", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mTrue\u001b[0m \u001b[1;32mor\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0my\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m0\u001b[0m \u001b[1;32mor\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 4\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mZeroDivisionError\u001b[0m: division by zero" ] } ], "source": [ "x = True or 3/0\n", "x\n", "y = 3/0 or True\n", "y\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The binary system and base conversions\n", "We use decimal numbers, that is, numbers in base 10. These numbers are represented using 10 digits (0-9).\n", "Binary numbers (in base 2) use two possible digits: 0-1.\n", "In general, a number in base $b$ will be represented using $b$ possible digits.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Converting from binary to decimal\n", " \n", "Let $x_{base 2} = a_{n-1} ... a_1 a_0$ be a binary number in base 2 with $n$ digits. \n", "The following formula returns its decimal representation:\n", " $$x_{base 10} = \\sum_{0 \\le k \\le n-1} a_k \\cdot 2^k$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Question 1: Let $N$ be a decimal positive integer, which has $n$ bits in its binary representation. What are the possible values of $N$ (as a function of the number of bits $n$)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Question 2: Let $N$ be a decimal positive integer. How many bits ($n$) are required for representing $N$ in binary (as a function of $N$)?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Converting from decimal to binary \n", "Converting from decimal to binary is done by integer division and modulo operations. \n", "We saw an algorithm for converting from decimal to a general base $b$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Base conversions using Python\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0b1010'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "str" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "'0xa1'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "345" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "13" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/plain": [ "161" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" }, { "ename": "ValueError", "evalue": "invalid literal for int() with base 2: 'a1'", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"1101\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"a1\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m16\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"a1\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mValueError\u001b[0m: invalid literal for int() with base 2: 'a1'" ] } ], "source": [ "bin(10)\n", "type(bin(10))\n", "hex(161)\n", "int(\"345\")\n", "int(\"1101\", 2)\n", "int(\"a1\", 16)\n", "int(\"a1\", 2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.2" } }, "nbformat": 4, "nbformat_minor": 1 }