Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.94 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\\rightarrow$Run All).\n",
  8. "\n",
  9. "Make sure you fill in any place that says `YOUR CODE HERE` or \"YOUR ANSWER HERE\", as well as your name and collaborators below:"
  10. ]
  11. },
  12. {
  13. "cell_type": "code",
  14. "execution_count": null,
  15. "metadata": {},
  16. "outputs": [],
  17. "source": [
  18. "NAME = \"Jack Nyange Njoroge\"\n",
  19. "COLLABORATORS = \"N/A\""
  20. ]
  21. },
  22. {
  23. "cell_type": "markdown",
  24. "metadata": {},
  25. "source": [
  26. "---"
  27. ]
  28. },
  29. {
  30. "cell_type": "markdown",
  31. "metadata": {
  32. "deletable": false,
  33. "editable": false,
  34. "nbgrader": {
  35. "checksum": "274b43d88d65df3de28733d850616dca",
  36. "grade": false,
  37. "grade_id": "cell-3f3ec0504e39b023",
  38. "locked": true,
  39. "schema_version": 1,
  40. "solution": false
  41. }
  42. },
  43. "source": [
  44. "# CS110 Pre-class Work 4.1\n",
  45. "\n",
  46. "## Question 1. (Exercise 6.5-1 from Cormen et al.)\n",
  47. "\n",
  48. "Illustrate the operation of $HEAP-EXTRACT-MAX$ on the heap $A= \\langle 15, 13, 9, 5, 12, 8, 7, 4, 0, 6, 2, 1 \\rangle$\n"
  49. ]
  50. },
  51. {
  52. "cell_type": "markdown",
  53. "metadata": {
  54. "deletable": false,
  55. "nbgrader": {
  56. "checksum": "a7f20996d6e22ca2d544500769888784",
  57. "grade": true,
  58. "grade_id": "cell-7de130b1caacd3ab",
  59. "locked": false,
  60. "points": 0,
  61. "schema_version": 1,
  62. "solution": true
  63. }
  64. },
  65. "source": [
  66. "It removes and returns the element of A with the largest key. In this case, 15."
  67. ]
  68. },
  69. {
  70. "cell_type": "markdown",
  71. "metadata": {
  72. "deletable": false,
  73. "editable": false,
  74. "nbgrader": {
  75. "checksum": "d60dd22e7498fab87e01bedd8064d513",
  76. "grade": false,
  77. "grade_id": "cell-6cb98701e5a82f6b",
  78. "locked": true,
  79. "schema_version": 1,
  80. "solution": false
  81. }
  82. },
  83. "source": [
  84. "## Question 2. (Exercise 6.5-2 from Cormen et al.)\n",
  85. "\n",
  86. "Illustrate the operation of $MAX-HEAP-INSERT(A, 10)$ on the heap $A=\\langle 15, 13, 9, 5, 12, 8, 7, 4, 0, 6, 2, 1\\rangle$."
  87. ]
  88. },
  89. {
  90. "cell_type": "markdown",
  91. "metadata": {
  92. "deletable": false,
  93. "nbgrader": {
  94. "checksum": "3652f0e0f430ec440dd4899558426c74",
  95. "grade": true,
  96. "grade_id": "cell-74f212522535433a",
  97. "locked": false,
  98. "points": 0,
  99. "schema_version": 1,
  100. "solution": true
  101. }
  102. },
  103. "source": [
  104. "It inserts 10 into the heap A."
  105. ]
  106. },
  107. {
  108. "cell_type": "markdown",
  109. "metadata": {
  110. "deletable": false,
  111. "editable": false,
  112. "nbgrader": {
  113. "checksum": "a986c9c7d690f05369df23660265d2a0",
  114. "grade": false,
  115. "grade_id": "cell-65c8d2b5e2e9deff",
  116. "locked": true,
  117. "schema_version": 1,
  118. "solution": false
  119. }
  120. },
  121. "source": [
  122. "## Question 3. Implementing Priority Queues Using Max and Min Heap Data Structures \n",
  123. "\n",
  124. "The next cell contains a Python implementation of a very basic priority queue based on a max heap data structure.<br>\n",
  125. "Please read and follow the <b>Instructions and Tasks</b> that are included below the next cell. These instructions and exercises will guide you through the Python code (i.e., <i><b>skip the Python code for now</b></i> and first proceed to read the instructions below the cell containing the Python code.) "
  126. ]
  127. },
  128. {
  129. "cell_type": "code",
  130. "execution_count": 2,
  131. "metadata": {
  132. "deletable": false,
  133. "editable": false,
  134. "nbgrader": {
  135. "checksum": "dae9240440201b16c0ddd0180b223363",
  136. "grade": false,
  137. "grade_id": "cell-834cafc3878bd920",
  138. "locked": true,
  139. "schema_version": 1,
  140. "solution": false
  141. }
  142. },
  143. "outputs": [],
  144. "source": [
  145. "# \n",
  146. "# Defining some basic binary tree functions\n",
  147. "#\n",
  148. "def left(i): # left(i): takes as input the array index of a parent node in the binary tree and \n",
  149. " return 2*i + 1 # returns the array index of its left child.\n",
  150. "\n",
  151. "def right(i): # right(i): takes as input the array index of a parent node in the binary tree and \n",
  152. " return 2*i + 2 # returns the array index of its right child.\n",
  153. "\n",
  154. "def parent(i): # parent(i): takes as input the array index of a node in the binary tree and\n",
  155. " return (i-1)//2 # returns the array index of its parent\n",
  156. "\n",
  157. "\n",
  158. "# Defining the Python class MaxHeapq to implement a max heap data structure.\n",
  159. "# Every Object in this class has two attributes:\n",
  160. "# - heap : A Python list where key values in the max heap are stored\n",
  161. "# - heap_size: An integer counter of the number of keys present in the max heap\n",
  162. "class MaxHeapq:\n",
  163. " \"\"\" \n",
  164. " This class implements properties and methods that support a max priority queue data structure\n",
  165. " \"\"\" \n",
  166. " # Class initialization method. Use: heapq_var = MaxHeapq()\n",
  167. " def __init__(self): \n",
  168. " self.heap = []\n",
  169. " self.heap_size = 0\n",
  170. "\n",
  171. " # This method returns the highest key in the priority queue. \n",
  172. " # Use: key_var = heapq_var.max()\n",
  173. " def maxk(self): \n",
  174. " return self.heap[0] \n",
  175. " \n",
  176. " # This method implements the INSERT key into a priority queue operation\n",
  177. " # Use: heapq_var.heappush(key)\n",
  178. " def heappush(self, key): \n",
  179. " \"\"\"\n",
  180. " Inserts the value of key onto the priority queue, maintaining the max heap invariant.\n",
  181. " \"\"\"\n",
  182. " self.heap.append(-float(\"inf\"))\n",
  183. " self.increase_key(self.heap_size,key)\n",
  184. " self.heap_size+=1\n",
  185. " \n",
  186. " # This method implements the INCREASE_KEY operation, which modifies the value of a key\n",
  187. " # in the max priority queue with a higher value. \n",
  188. " # Use heapq_var.increase_key(i, new_key)\n",
  189. " def increase_key(self, i, key): \n",
  190. " if key < self.heap[i]:\n",
  191. " raise ValueError('new key is smaller than the current key')\n",
  192. " self.heap[i] = key\n",
  193. " while i > 0 and self.heap[parent(i)] < self.heap[i]:\n",
  194. " j = parent(i)\n",
  195. " holder = self.heap[j]\n",
  196. " self.heap[j] = self.heap[i]\n",
  197. " self.heap[i] = holder\n",
  198. " i = j \n",
  199. " \n",
  200. " # This method implements the MAX_HEAPIFY operation for the max priority queue. The input is \n",
  201. " # the array index of the root node of the subtree to be heapify.\n",
  202. " # Use heapq_var.heapify(i) \n",
  203. " def heapify(self, i):\n",
  204. " l = left(i)\n",
  205. " r = right(i)\n",
  206. " heap = self.heap\n",
  207. " if l <= (self.heap_size-1) and heap[l]>heap[i]:\n",
  208. " largest = l\n",
  209. " else:\n",
  210. " largest = i\n",
  211. " if r <= (self.heap_size-1) and heap[r] > heap[largest]:\n",
  212. " largest = r\n",
  213. " if largest != i:\n",
  214. " heap[i], heap[largest] = heap[largest], heap[i]\n",
  215. " self.heapify(largest)\n",
  216. "\n",
  217. " # This method implements the EXTRACT_MAX operation. It returns the largest key in \n",
  218. " # the max priority queue and removes this key from the max priority queue.\n",
  219. " # Use key_var = heapq_var.heappop() \n",
  220. " def heappop(self):\n",
  221. " if self.heap_size < 1:\n",
  222. " raise ValueError('Heap underflow: There are no keys in the priority queue ')\n",
  223. " maxk = self.heap[0]\n",
  224. " self.heap[0] = self.heap[-1]\n",
  225. " self.heap.pop()\n",
  226. " self.heap_size-=1\n",
  227. " self.heapify(0)\n",
  228. " return maxk"
  229. ]
  230. },
  231. {
  232. "cell_type": "markdown",
  233. "metadata": {
  234. "deletable": false,
  235. "editable": false,
  236. "nbgrader": {
  237. "checksum": "0fe80b7551c447558abc43ec307de37e",
  238. "grade": false,
  239. "grade_id": "cell-2462e8ce46926058",
  240. "locked": true,
  241. "schema_version": 1,
  242. "solution": false
  243. }
  244. },
  245. "source": [
  246. "## Instructions and Tasks.\n",
  247. "The goal of these tasks is for you to learn how to implement, build, and manage priority queues in Python. \n",
  248. "\n",
  249. "First, let us practice building a max priority queue from a random list of keys.<br> \n",
  250. "For example, given a list of keys: [4,3,6,8,2,-5,100], we want to obtain a max priority queue that looks like this: [100, 6, 8, 3, 2, -5, 4], recall that in a max priority list the highest key should be on top (given priority). \n",
  251. "\n",
  252. "### Task 0.\n",
  253. "Check whether the list [100, 6, 8, 3, 2, -5, 4] is indeed a max priority queue. Recall that a max priority queue data structure is based on a max heap data structure. Give a short explanation."
  254. ]
  255. },
  256. {
  257. "cell_type": "markdown",
  258. "metadata": {
  259. "deletable": false,
  260. "nbgrader": {
  261. "checksum": "d96ebcf5802ceeb1a33e34c5a5afe211",
  262. "grade": true,
  263. "grade_id": "cell-5e0b898075b25073",
  264. "locked": false,
  265. "points": 0,
  266. "schema_version": 1,
  267. "solution": true
  268. }
  269. },
  270. "source": [
  271. "It is indeed a max priority queue. The max element is the root and all parents are greater than their descendants."
  272. ]
  273. },
  274. {
  275. "cell_type": "markdown",
  276. "metadata": {
  277. "deletable": false,
  278. "editable": false,
  279. "nbgrader": {
  280. "checksum": "0a9b4ea61e7caa5bbeb1fa79575f31f9",
  281. "grade": false,
  282. "grade_id": "cell-01e1945386d515a2",
  283. "locked": true,
  284. "schema_version": 1,
  285. "solution": false
  286. }
  287. },
  288. "source": [
  289. "### Task 1.\n",
  290. "The following cell uses the Python implementation of a max priority queue. This a good time to review the Python code above and then follow the rest of these instructions."
  291. ]
  292. },
  293. {
  294. "cell_type": "code",
  295. "execution_count": 3,
  296. "metadata": {
  297. "deletable": false,
  298. "editable": false,
  299. "nbgrader": {
  300. "checksum": "da3a43089e2db1466a2db091855b07e0",
  301. "grade": false,
  302. "grade_id": "cell-e301a5a468f9b84e",
  303. "locked": true,
  304. "schema_version": 1,
  305. "solution": false
  306. }
  307. },
  308. "outputs": [
  309. {
  310. "name": "stdout",
  311. "output_type": "stream",
  312. "text": [
  313. "[100, 6, 8, 3, 2, -5, 4]\n"
  314. ]
  315. }
  316. ],
  317. "source": [
  318. "# GOAL: BUILD HEAP FROM [4,3,6,8,2,-5,100]\n",
  319. "# Study the following lines of code, execute the cell and make sure you understand how the\n",
  320. "# Python implementation of the MaxHeapq is used here and the output from these lines.\n",
  321. "A = [4,3,6,8,2,-5,100]\n",
  322. "my_heap = MaxHeapq()\n",
  323. "\n",
  324. "for key in A:\n",
  325. " my_heap.heappush(key)\n",
  326. "\n",
  327. "print(my_heap.heap)"
  328. ]
  329. },
  330. {
  331. "cell_type": "markdown",
  332. "metadata": {
  333. "deletable": false,
  334. "editable": false,
  335. "nbgrader": {
  336. "checksum": "c3ea1d8efdd3151a6a3bb4f027f292b7",
  337. "grade": false,
  338. "grade_id": "cell-cf7dd96ee4eb3c43",
  339. "locked": true,
  340. "schema_version": 1,
  341. "solution": false
  342. }
  343. },
  344. "source": [
  345. "### Task 2. \n",
  346. "Given the list [6,4,7,9,10,-5,-6,12,8,3,1,-10], build a max heap. You should store the Python list that represents the max heap in a variable named `my_heap_list`.\n",
  347. "\n"
  348. ]
  349. },
  350. {
  351. "cell_type": "code",
  352. "execution_count": 12,
  353. "metadata": {
  354. "deletable": false,
  355. "nbgrader": {
  356. "checksum": "5cfb440b6fd86152d8ec5aaf1b166156",
  357. "grade": false,
  358. "grade_id": "cell-8f1991aebb9ab87c",
  359. "locked": false,
  360. "schema_version": 1,
  361. "solution": true
  362. }
  363. },
  364. "outputs": [
  365. {
  366. "name": "stdout",
  367. "output_type": "stream",
  368. "text": [
  369. "[12, 10, 6, 9, 7, -5, -6, 4, 8, 3, 1, -10]\n"
  370. ]
  371. }
  372. ],
  373. "source": [
  374. "B = [6,4,7,9,10,-5,-6,12,8,3,1,-10]\n",
  375. "my_heap_list = MaxHeapq()\n",
  376. "\n",
  377. "for key in B:\n",
  378. " my_heap_list.heappush(key)\n",
  379. "\n",
  380. "print(my_heap_list.heap)"
  381. ]
  382. },
  383. {
  384. "cell_type": "code",
  385. "execution_count": null,
  386. "metadata": {
  387. "deletable": false,
  388. "editable": false,
  389. "nbgrader": {
  390. "checksum": "26429f9e44e6cc1038e2742a4d470879",
  391. "grade": true,
  392. "grade_id": "cell-fa85b4b29f6da1af",
  393. "locked": true,
  394. "points": 1,
  395. "schema_version": 1,
  396. "solution": false
  397. }
  398. },
  399. "outputs": [],
  400. "source": [
  401. "# Please ignore this cell. This cell is for us to implement the tests \n",
  402. "# to see if your code works properly. "
  403. ]
  404. },
  405. {
  406. "cell_type": "markdown",
  407. "metadata": {
  408. "deletable": false,
  409. "editable": false,
  410. "nbgrader": {
  411. "checksum": "9f8056e40f22478e49e5dbf9b316cb44",
  412. "grade": false,
  413. "grade_id": "cell-630703ffa2b4b776",
  414. "locked": true,
  415. "schema_version": 1,
  416. "solution": false
  417. }
  418. },
  419. "source": [
  420. "### Task 3.\n",
  421. "Using the Python code that implements the class `MaxHeapq` as a reference, build a class `MinHeapq`, a min priority queue. Your class should contain the following method: `mink`, `heappush`, `decrease_key`, `heapify`, and `heappop`."
  422. ]
  423. },
  424. {
  425. "cell_type": "code",
  426. "execution_count": null,
  427. "metadata": {
  428. "deletable": false,
  429. "nbgrader": {
  430. "checksum": "0cd32eb273c3524ad096e0817d58fac3",
  431. "grade": false,
  432. "grade_id": "cell-927eee0091ce8d12",
  433. "locked": false,
  434. "schema_version": 1,
  435. "solution": true
  436. }
  437. },
  438. "outputs": [],
  439. "source": [
  440. "class MinHeapq:\n",
  441. " # YOUR CODE HERE\n",
  442. " raise NotImplementedError()"
  443. ]
  444. },
  445. {
  446. "cell_type": "code",
  447. "execution_count": 21,
  448. "metadata": {},
  449. "outputs": [],
  450. "source": [
  451. "# \n",
  452. "# Defining some basic binary tree functions\n",
  453. "#\n",
  454. "def left(i): # left(i): takes as input the array index of a parent node in the binary tree and \n",
  455. " return 2*i + 1 # returns the array index of its left child.\n",
  456. "\n",
  457. "def right(i): # right(i): takes as input the array index of a parent node in the binary tree and \n",
  458. " return 2*i + 2 # returns the array index of its right child.\n",
  459. "\n",
  460. "def parent(i): # parent(i): takes as input the array index of a node in the binary tree and\n",
  461. " return (i-1)//2 # returns the array index of its parent\n",
  462. "\n",
  463. "\n",
  464. "# Defining the Python class MaxHeapq to implement a max heap data structure.\n",
  465. "# Every Object in this class has two attributes:\n",
  466. "# - heap : A Python list where key values in the max heap are stored\n",
  467. "# - heap_size: An integer counter of the number of keys present in the max heap\n",
  468. "class MinHeapq:\n",
  469. " \"\"\" \n",
  470. " This class implements properties and methods that support a max priority queue data structure\n",
  471. " \"\"\" \n",
  472. " # Class initialization method. Use: heapq_var = MaxHeapq()\n",
  473. " def __init__(self): \n",
  474. " self.heap = []\n",
  475. " self.heap_size = 0\n",
  476. "\n",
  477. " # This method returns the highest key in the priority queue. \n",
  478. " # Use: key_var = heapq_var.max()\n",
  479. " def mink(self): \n",
  480. " return self.heap[0] \n",
  481. " \n",
  482. " # This method implements the INSERT key into a priority queue operation\n",
  483. " # Use: heapq_var.heappush(key)\n",
  484. " def heappush(self, key): \n",
  485. " \"\"\"\n",
  486. " Inserts the value of key onto the priority queue, maintaining the max heap invariant.\n",
  487. " \"\"\"\n",
  488. " self.heap.append(-float(\"inf\"))\n",
  489. " self.decrease_key(self.heap_size,key)\n",
  490. " self.heap_size+=1\n",
  491. " \n",
  492. " # This method implements the INCREASE_KEY operation, which modifies the value of a key\n",
  493. " # in the max priority queue with a higher value. \n",
  494. " # Use heapq_var.increase_key(i, new_key)\n",
  495. " def decrease_key(self, i, key): \n",
  496. " if key < self.heap[i]:\n",
  497. " raise ValueError('new key is larger than the current key')\n",
  498. " self.heap[i] = key\n",
  499. " while i > 0 and self.heap[parent(i)] > self.heap[i]:\n",
  500. " j = parent(i)\n",
  501. " holder = self.heap[j]\n",
  502. " self.heap[j] = self.heap[i]\n",
  503. " self.heap[i] = holder\n",
  504. " i = j \n",
  505. " \n",
  506. " # This method implements the MAX_HEAPIFY operation for the max priority queue. The input is \n",
  507. " # the array index of the root node of the subtree to be heapify.\n",
  508. " # Use heapq_var.heapify(i) \n",
  509. " def heapify(self, i):\n",
  510. " l = left(i)\n",
  511. " r = right(i)\n",
  512. " heap = self.heap\n",
  513. " if l >= (self.heap_size-1) and heap[l]<heap[i]:\n",
  514. " smallest = l\n",
  515. " else:\n",
  516. " smallest = i\n",
  517. " if r >= (self.heap_size-1) and heap[r] < heap[smallest]:\n",
  518. " smallest = r\n",
  519. " if smallest != i:\n",
  520. " heap[i], heap[smallest] = heap[smallest], heap[i]\n",
  521. " self.heapify(smallest)\n",
  522. "\n",
  523. " # This method implements the EXTRACT_MAX operation. It returns the largest key in \n",
  524. " # the max priority queue and removes this key from the max priority queue.\n",
  525. " # Use key_var = heapq_var.heappop() \n",
  526. " def heappop(self):\n",
  527. " if self.heap_size < 1:\n",
  528. " raise ValueError('Heap underflow: There are no keys in the priority queue ')\n",
  529. " mink = self.heap[0]\n",
  530. " self.heap[0] = self.heap[-1]\n",
  531. " self.heap.pop()\n",
  532. " self.heap_size-=1\n",
  533. " self.heapify(0)\n",
  534. " return mink"
  535. ]
  536. },
  537. {
  538. "cell_type": "code",
  539. "execution_count": 22,
  540. "metadata": {},
  541. "outputs": [
  542. {
  543. "name": "stdout",
  544. "output_type": "stream",
  545. "text": [
  546. "[-5, 3, 2, 8, 4, 6, 100]\n"
  547. ]
  548. }
  549. ],
  550. "source": [
  551. "#testing my min heap\n",
  552. "A = [4,3,6,8,2,-5,100]\n",
  553. "my_heap = MinHeapq()\n",
  554. "\n",
  555. "for key in A:\n",
  556. " my_heap.heappush(key)\n",
  557. "\n",
  558. "print(my_heap.heap)"
  559. ]
  560. },
  561. {
  562. "cell_type": "code",
  563. "execution_count": null,
  564. "metadata": {
  565. "deletable": false,
  566. "editable": false,
  567. "nbgrader": {
  568. "checksum": "24bca6c047b8f9473f8bc38c57d6b0b5",
  569. "grade": true,
  570. "grade_id": "cell-94922952c1f6d73e",
  571. "locked": true,
  572. "points": 1,
  573. "schema_version": 1,
  574. "solution": false
  575. }
  576. },
  577. "outputs": [],
  578. "source": [
  579. "# Please ignore this cell. This cell is for us to implement the tests \n",
  580. "# to see if your code works properly. "
  581. ]
  582. },
  583. {
  584. "cell_type": "markdown",
  585. "metadata": {
  586. "deletable": false,
  587. "editable": false,
  588. "nbgrader": {
  589. "checksum": "549d036086c8cfaf3a1c121c840a84be",
  590. "grade": false,
  591. "grade_id": "cell-a1d697aca93c202c",
  592. "locked": true,
  593. "schema_version": 1,
  594. "solution": false
  595. }
  596. },
  597. "source": [
  598. "### Task 4. \n",
  599. "\n",
  600. "Use your `MinHeapq` implementation to build a min priority queue out of the list [6,4,7,9,10,-5,-6,12,8,3,1,-10]. You should store the Python list that represents the min heap in a variable named `my_heap_list`."
  601. ]
  602. },
  603. {
  604. "cell_type": "code",
  605. "execution_count": 24,
  606. "metadata": {
  607. "deletable": false,
  608. "nbgrader": {
  609. "checksum": "ce29dba864f0d616282d83cf6c2dab9f",
  610. "grade": false,
  611. "grade_id": "cell-bc27d7bf8580d64a",
  612. "locked": false,
  613. "schema_version": 1,
  614. "solution": true
  615. }
  616. },
  617. "outputs": [
  618. {
  619. "name": "stdout",
  620. "output_type": "stream",
  621. "text": [
  622. "[-10, 1, -6, 8, 3, -5, 4, 12, 9, 10, 6, 7]\n"
  623. ]
  624. }
  625. ],
  626. "source": [
  627. "#testing my min heap\n",
  628. "B = [6,4,7,9,10,-5,-6,12,8,3,1,-10]\n",
  629. "my_heap = MinHeapq()\n",
  630. "\n",
  631. "for key in B:\n",
  632. " my_heap.heappush(key)\n",
  633. "\n",
  634. "print(my_heap.heap)"
  635. ]
  636. },
  637. {
  638. "cell_type": "code",
  639. "execution_count": null,
  640. "metadata": {
  641. "deletable": false,
  642. "editable": false,
  643. "nbgrader": {
  644. "checksum": "c40c41c7c84c918a52ef50cac5992600",
  645. "grade": true,
  646. "grade_id": "cell-c76c6d24fa297106",
  647. "locked": true,
  648. "points": 1,
  649. "schema_version": 1,
  650. "solution": false
  651. }
  652. },
  653. "outputs": [],
  654. "source": [
  655. "# Please ignore this cell. This cell is for us to implement the tests \n",
  656. "# to see if your code works properly. "
  657. ]
  658. }
  659. ],
  660. "metadata": {
  661. "kernelspec": {
  662. "display_name": "Python 3",
  663. "language": "python",
  664. "name": "python3"
  665. },
  666. "language_info": {
  667. "codemirror_mode": {
  668. "name": "ipython",
  669. "version": 3
  670. },
  671. "file_extension": ".py",
  672. "mimetype": "text/x-python",
  673. "name": "python",
  674. "nbconvert_exporter": "python",
  675. "pygments_lexer": "ipython3",
  676. "version": "3.6.5"
  677. }
  678. },
  679. "nbformat": 4,
  680. "nbformat_minor": 2
  681. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement