Commit ad54ac4c authored by Emilio Ambite's avatar Emilio Ambite

Repositorio de notebooks de python para SCW 2019

parent e7783177
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Errors and Exceptions\n",
"\n",
"Two main questions to be answered\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li>How Python report errors?\n",
"\n",
"<li>How I can handle errors in Python programs?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Every programmer makes Errors\n",
"\n",
"Errors in Python have a very specific form called <b>\"traceback\"</b>. Traceback are made of levels wich are marked with special symbol <b>--></b>"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"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<ipython-input-1-c34fcf537534>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mice_creams\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[0mfavorite_ice_cream\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;32m<ipython-input-1-c34fcf537534>\u001b[0m in \u001b[0;36mfavorite_ice_cream\u001b[1;34m()\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;34m\"strawberry\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m ]\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mice_creams\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[0mfavorite_ice_cream\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mIndexError\u001b[0m: list index out of range"
]
}
],
"source": [
"# This code has an intentional error. You can type it directly or\n",
"# use it for reference to understand the error message below.\n",
"def favorite_ice_cream():\n",
" ice_creams = [\n",
" \"chocolate\",\n",
" \"vanilla\",\n",
" \"strawberry\"\n",
" ]\n",
" print(ice_creams[3])\n",
"\n",
"favorite_ice_cream()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Traceback with two levels. Are read from bottom to top:\n",
"<li> 1) Last level is the line with the error actually is\n",
"\n",
"<li> 2) Upper level(s) show what function was executed to get the next level down"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tracebacks could be very long but important info is usually at the bottom"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Error categories"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"All errors at the end of a traceback, are usually in the form:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<code>Category: Some more info</code>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Where Categories are:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Syntax Errors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You forget a colon, add too many spaces, forget a parenthesis etc... Makes Python not to know how to read your program. That gives you:\n",
"<code>SyntaxError</code>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-2-dbf32ad5d3e8>, line 1)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-2-dbf32ad5d3e8>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m def some_function()\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
]
}
],
"source": [
"def some_function()\n",
" msg = \"hello, world!\"\n",
" print(msg)\n",
" return msg"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"ename": "IndentationError",
"evalue": "unexpected indent (<ipython-input-3-e169556d667b>, line 4)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-3-e169556d667b>\"\u001b[1;36m, line \u001b[1;32m4\u001b[0m\n\u001b[1;33m return msg\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m unexpected indent\n"
]
}
],
"source": [
"def some_function():\n",
" msg = \"hello, world!\"\n",
" print(msg)\n",
" return msg"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li>Remember: Both SyntaxError and IntentationError indicate a problem with the syntax of the program"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Variable Name Errors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Difficult to state a general case but common mistakes are:\n",
"<li> You meant to use a string but forgot quotes\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'hello' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-1-43a14fcd4265>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mhello\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mNameError\u001b[0m: name 'hello' is not defined"
]
}
],
"source": [
"print(hello)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li> You forgot to create a variable before using it\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'count' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-6-3cc942c225b7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mnumber\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mcount\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcount\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mnumber\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"The count is:\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcount\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'count' is not defined"
]
}
],
"source": [
"for number in range(10):\n",
" count = count + number\n",
"print(\"The count is:\", count)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li> There is a typo in a variable name (maybe because Python's Case Sensitivity)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'count' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-7-79d2bb4fcc22>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mCount\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[1;32mfor\u001b[0m \u001b[0mnumber\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mcount\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcount\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mnumber\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"The count is:\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcount\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'count' is not defined"
]
}
],
"source": [
"Count = 0\n",
"for number in range(10):\n",
" count = count + number\n",
"print(\"The count is:\", count)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### IndexErrors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Typically you try to access something out of bounds:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Letter #1 is a\n",
"Letter #2 is b\n",
"Letter #3 is c\n"
]
},
{
"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<ipython-input-9-656a22fa6ec5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Letter #2 is\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mletters\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Letter #3 is\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mletters\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Letter #4 is\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mletters\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m]\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": [
"letters = ['a', 'b', 'c']\n",
"print(\"Letter #1 is\", letters[0])\n",
"print(\"Letter #2 is\", letters[1])\n",
"print(\"Letter #3 is\", letters[2])\n",
"print(\"Letter #4 is\", letters[3])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### File Errors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Typically two:\n",
"<li> Trying to access a file that does not exist:"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: 'myfile.txt'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-10-f6e1ac4aee96>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mfile_handle\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'myfile.txt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'myfile.txt'"
]
}
],
"source": [
"file_handle = open('myfile.txt', 'r')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li> You try to read(write) a write-only(read-only) file:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"ename": "UnsupportedOperation",
"evalue": "not readable",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mUnsupportedOperation\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-12-02e2f546ed29>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mfile_handle\u001b[0m\u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'myfile.txt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'w'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mfile_handle\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mUnsupportedOperation\u001b[0m: not readable"
]
}
],
"source": [
"file_handle= open('myfile.txt', 'w')\n",
"file_handle.read()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercises\n",
"\n",
"### Reading Error Messages "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Read the python code and the resulting traceback below, and answer the following questions:\n",
"\n",
"* How many levels does the traceback have? **3 levels**\n",
"* What is the function name where the error occurred? **print_message**\n",
"* On which line number in this function did the error occurr? **11**\n",
"* What is the type of error? **Keyerror**\n",
"* What is the error message? **'Friday'**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```\n",
"# This code has an intentional error. Do not type it directly;\n",
"# use it for reference to understand the error message below.\n",
"def print_message(day):\n",
" messages = {\n",
" \"monday\": \"Hello, world!\",\n",
" \"tuesday\": \"Today is tuesday!\",\n",
" \"wednesday\": \"It is the middle of the week.\",\n",
" \"thursday\": \"Today is Donnerstag in German!\",\n",
" \"friday\": \"Last day of the week!\",\n",
" \"saturday\": \"Hooray for the weekend!\",\n",
" \"sunday\": \"Aw, the weekend is almost over.\"\n",
" }\n",
" print(messages[day])\n",
"\n",
"def print_friday_message():\n",
" print_message(\"Friday\")\n",
"\n",
"print_friday_message()\n",
"---------------------------------------------------------------------------\n",
"KeyError Traceback (most recent call last)\n",
"<ipython-input-1-4be1945adbe2> in <module>()\n",
" 14 print_message(\"Friday\")\n",
" 15\n",
"---> 16 print_friday_message()\n",
"\n",
"<ipython-input-1-4be1945adbe2> in print_friday_message()\n",
" 12\n",
" 13 def print_friday_message():\n",
"---> 14 print_message(\"Friday\")\n",
" 15\n",
" 16 print_friday_message()\n",
"\n",
"<ipython-input-1-4be1945adbe2> in print_message(day)\n",
" 9 \"sunday\": \"Aw, the weekend is almost over.\"\n",
" 10 }\n",
"---> 11 print(messages[day])\n",
" 12\n",
" 13 def print_friday_message():\n",
"\n",
"KeyError: 'Friday'```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Identifying Syntax Errors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Read the code below, and (without running it) try to identify what the errors are.\n",
"\n",
"Run the code, and read the error message. Is it a SyntaxError or an IndentationError?\n",
"Fix the error.\n",
"Repeat steps 2 and 3, until you have fixed all the errors.\n",
"```\n",
"def another_function # Falta ():\n",
" print(\"Syntax errors are annoying.\")\n",
" print(\"But at least python tells us about them!\") # Mala indentación\n",
" print(\"So they are usually not too hard to fix.\")```"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Syntax errors are annoying.\n",
"But at least python tells us about them!\n",
"So they are usually not too hard to fix.\n"
]
}
],
"source": [
"def another_function():\n",
" print(\"Syntax errors are annoying.\")\n",
" print(\"But at least python tells us about them!\")\n",
" print(\"So they are usually not too hard to fix.\")\n",
"another_function()"
]
}
],
"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.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Errors and Exceptions\n",
"\n",
"Two main questions to be answered\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li>How Python report errors?\n",
"\n",
"<li>How I can handle errors in Python programs?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Every programmer makes Errors\n",
"\n",
"Errors in Python have a very specific form called <b>\"traceback\"</b>. Traceback are made of levels wich are marked with special symbol <b>--></b>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# This code has an intentional error. You can type it directly or\n",
"# use it for reference to understand the error message below.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Traceback with two levels. Are read from bottom to top:\n",
"<li> 1) Last level is the line with the error actually is\n",
"\n",
"<li> 2) Upper level(s) show what function was executed to get the next level down"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tracebacks could be very long but important info is usually at the bottom"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Error categories"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"All errors at the end of a traceback, are usually in the form:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<code>Category: Some more info</code>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Where Categories are:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Syntax Errors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You forget a colon, add too many spaces, forget a parenthesis etc... Makes Python not to know how to read your program. That gives you:\n",
"<code>SyntaxError</code>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li>Remember: Both SyntaxError and IntentationError indicate a problem with the syntax of the program"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Variable Name Errors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Difficult to state a general case but common mistakes are:\n",
"<li> You meant to use a string but forgot quotes\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li> You forgot to create a variable before using it\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<li> There is a typo in