"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"IFrame('https://trinket.io/embed/python3/3fe4c8f3f4', 700, 500)"
]
},
{
"cell_type": "markdown",
"id": "4416f023-d757-4b2f-ae93-44e16fd07cfe",
"metadata": {},
"source": [
"## Quiz"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "66a8a2ea-db81-4ecb-9145-409cee0871e8",
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"quiz = '''\n",
"# What kind of data structure is made with [ ]?\n",
"mc\n",
"* List\n",
"-c t\n",
"-f\n",
"\n",
"* Tuple\n",
"-c f\n",
"-f\n",
"\n",
"* Dictionary\n",
"-c f\n",
"-f\n",
"\n",
"# What kind of data structure is made with ()?\n",
"mc\n",
"* List\n",
"-c f\n",
"-f\n",
"\n",
"* Tuple\n",
"-c t\n",
"-f\n",
"\n",
"* Dictionary\n",
"-c f\n",
"-f\n",
"\n",
"# What kind of data structure is made with {}?\n",
"mc\n",
"* List\n",
"-c f\n",
"-f\n",
"\n",
"* Tuple\n",
"-c f\n",
"-f\n",
"\n",
"* Dictionary\n",
"-c t\n",
"-f\n",
"\n",
"# What are the two parts of a dictionary?\n",
"mc\n",
"* Key\n",
"-c t\n",
"-f\n",
"\n",
"* Value\n",
"-c t\n",
"-f\n",
"\n",
"* Index\n",
"-c f\n",
"-f\n",
"\n",
"# What index does a Python list start at?\n",
"mc\n",
"* 0\n",
"-c t\n",
"-f\n",
"\n",
"* 1\n",
"-c f\n",
"-f\n",
"'''"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "7eb3e678-de37-46ea-8122-9698d6260b5f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
},
{
"data": {
"text/html": [
" \n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from jupyterquiz import display_quiz\n",
"import md2json\n",
"import json\n",
"myquiz = md2json.convert(quiz)\n",
"myquiz = json.loads(myquiz)\n",
"display_quiz(myquiz)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b1bf16eb-f123-4061-b060-23787e4a3176",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}