Skip to content

Commit 5b56fbd

Browse files
committed
another question for users
1 parent 1b5bbbd commit 5b56fbd

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

lectures/01-python/python-control-flow.ipynb

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,9 @@
471471
"name": "stdout",
472472
"output_type": "stream",
473473
"text": [
474-
"key = key2, value = 2\n",
474+
"key = key1, value = 1\n",
475475
"key = key3, value = 3\n",
476-
"key = key1, value = 1\n"
476+
"key = key2, value = 2\n"
477477
]
478478
}
479479
],
@@ -593,6 +593,28 @@
593593
"cell_type": "markdown",
594594
"metadata": {},
595595
"source": [
596+
"## Q 1\n",
597+
"\n",
598+
"We can use the `input()` function to ask for input from the prompt (note: in python 2 the function was called `raw_input()`).\n",
599+
"\n",
600+
"Create an empty list and use a while loop to ask the user for input and append their input to the list. Keep looping until 10 items are added to the list"
601+
]
602+
},
603+
{
604+
"cell_type": "code",
605+
"execution_count": null,
606+
"metadata": {
607+
"collapsed": true
608+
},
609+
"outputs": [],
610+
"source": []
611+
},
612+
{
613+
"cell_type": "markdown",
614+
"metadata": {},
615+
"source": [
616+
"## Q 2\n",
617+
"\n",
596618
"Here's some text (the Gettysburg Address). Our goal is to count how many times each word repeats. We'll do a brute force method first, and then we'll look a ways to do it more efficiently (and compactly)."
597619
]
598620
},
@@ -1045,7 +1067,7 @@
10451067
"cell_type": "markdown",
10461068
"metadata": {},
10471069
"source": [
1048-
"## 1\n",
1070+
"## your task\n",
10491071
"\n",
10501072
"Create a dictionary that uses the unique words as keys and has as a value the number of times that word appears. \n",
10511073
"\n",

0 commit comments

Comments
 (0)