Commit f6f6ae3e authored by Toby Hodges's avatar Toby Hodges
Browse files

added debugging exercise to worksheet 1.

parent e51b3eda
......@@ -1248,6 +1248,33 @@
"* Some data types are sequences, which let us access individual elements at will.\n",
"* Sequence data types allow us to step through the values in them, but to do that we need to take some first steps towards writing real programs."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### _Debugging Exercise_"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The lines below have mistakes in them, which produce errors when they are run. Try to identify the problems in the code, and fix them so that they run without error."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"cake flavours = ['chocolate', 'coffee', 'carrot', 'vanilla']\n",
"cake_flavours.append('lemon')\n",
" print(cake_flavours)"
]
}
],
"metadata": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment