Skip to content

Commit d56f0f5

Browse files
committed
Updating the notebooks
1 parent 5bebacb commit d56f0f5

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

chapters/chap09.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@
895895
"id": "f90bd9ea",
896896
"metadata": {},
897897
"source": [
898-
"The result it a list.\n",
898+
"The result is a list.\n",
899899
"To convert the list to a string, we can use `join`."
900900
]
901901
},

chapters/chap10.ipynb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@
477477
"metadata": {},
478478
"source": [
479479
"The following function loops through the words in the list.\n",
480-
"For each one, it reverses the letters and then checks whether the reversed word in the word list."
480+
"For each one, it reverses the letters and then checks whether the reversed word is in the word list."
481481
]
482482
},
483483
{
@@ -505,6 +505,17 @@
505505
"If it doesn't find what it's looking for -- which happens most of the time -- it has to search all the way to the end."
506506
]
507507
},
508+
{
509+
"cell_type": "markdown",
510+
"id": "fac41347",
511+
"metadata": {
512+
"tags": []
513+
},
514+
"source": [
515+
"To measure how long a function takes, we can use `%time` which is one of Jupyter's \"built-in magic commands\".\n",
516+
"These commands are not part of the Python language, so they might not work in other development environments."
517+
]
518+
},
508519
{
509520
"cell_type": "code",
510521
"execution_count": 58,
@@ -590,6 +601,15 @@
590601
"This function takes less than one hundredth of a second, so it's about 10,000 times faster than the previous version."
591602
]
592603
},
604+
{
605+
"cell_type": "markdown",
606+
"id": "4cd91c99",
607+
"metadata": {},
608+
"source": [
609+
"In general, the time it takes to find an element in a list is proportional to the length of the list.\n",
610+
"The time it takes to find a key in a dictionary is almost constant -- regardless of the number of items."
611+
]
612+
},
593613
{
594614
"cell_type": "code",
595615
"execution_count": 62,
@@ -602,15 +622,6 @@
602622
"%time much_faster()"
603623
]
604624
},
605-
{
606-
"cell_type": "markdown",
607-
"id": "4cd91c99",
608-
"metadata": {},
609-
"source": [
610-
"In general, the time it takes to find an element in a list is proportional to the length of the list.\n",
611-
"The time it takes to find a key in a dictionary is almost constant -- regardless of the number of items."
612-
]
613-
},
614625
{
615626
"cell_type": "markdown",
616627
"id": "b3bfa8a5",
@@ -1201,17 +1212,6 @@
12011212
"In the notebook for this chapter, you'll see where these measurements come from."
12021213
]
12031214
},
1204-
{
1205-
"cell_type": "markdown",
1206-
"id": "c6f39f84",
1207-
"metadata": {
1208-
"tags": []
1209-
},
1210-
"source": [
1211-
"To measure how long a function takes, we can use `%time` which is one of Jupyter's \"built-in magic commands\".\n",
1212-
"These commands are not part of the Python language, so they might not work in other development environments."
1213-
]
1214-
},
12151215
{
12161216
"cell_type": "code",
12171217
"execution_count": 50,

0 commit comments

Comments
 (0)