You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _sources/chap08.ipynb
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -7270,12 +7270,12 @@
7270
7270
"Each attempt has to be recognized as a word, not including proper nouns.\n",
7271
7271
"After each attempt, you get information about which of the letters you guessed appear in the target word, and which ones are in the correct position.\n",
7272
7272
"\n",
7273
-
"For example, suppose the target word is `MOWER` and you guess `TRIED`. You would learn that `E` is in the word and in the correct position, `R` is in the word but not in the correct position, and `T`, `I`, and `D` are not in the word.\n",
7273
+
"For example, suppose the target word is `MOWER` and you guess `TRIED`.\n",
7274
+
"You would learn that `E` is in the word and in the correct position, `R` is in the word but not in the correct position, and `T`, `I`, and `D` are not in the word.\n",
7274
7275
"\n",
7275
7276
"As a different example, suppose you have guessed the words `SPADE` and `CLERK`, and you've learned that `E` is in the word, but not in either of those positions, and none of the other letters appear in the word.\n",
7276
-
"\n",
7277
7277
"Of the words in the word list, how many could be the target word?\n",
7278
-
"Write a function called `check_word` that takes a five-letter word and checks whether it could be the target word."
7278
+
"Write a function called `check_word` that takes a five-letter word and checks whether it could be the target word, given these guesses."
7279
7279
]
7280
7280
},
7281
7281
{
@@ -7487,7 +7487,7 @@
7487
7487
"\n",
7488
7488
"In particular, he says it is \"shameless in its repetition of the same adjective,\" and mentions in particular the number of times \"its characters either shudder or turn pale.\"\n",
7489
7489
"\n",
7490
-
"To see whether his objection is valid, let's count the number number of times the word `pale` appears in any form, including `pale`, `pales`, `paled`, and `paleness`, as well as the related word `pallor`. \n",
7490
+
"To see whether his objection is valid, let's count the number number of lines that contain the word `pale` in any form, including `pale`, `pales`, `paled`, and `paleness`, as well as the related word `pallor`. \n",
7491
7491
"Use a single regular expression that matches all of these words and no others."
7492
7492
]
7493
7493
},
@@ -7827,7 +7827,7 @@
7827
7827
]
7828
7828
},
7829
7829
"source": [
7830
-
"By my count, these words appear `223` times in a book that contains about `461,000` words. Mr. Eco might have a point."
7830
+
"By my count, these words appear on `223` lines of the book, so Mr. Eco might have a point."
<p>“Wordle” is an online word game where the objective is to guess a five-letter word in six or fewer attempts.
1355
1355
Each attempt has to be recognized as a word, not including proper nouns.
1356
1356
After each attempt, you get information about which of the letters you guessed appear in the target word, and which ones are in the correct position.</p>
1357
-
<p>For example, suppose the target word is <codeclass="docutils literal notranslate"><spanclass="pre">MOWER</span></code> and you guess <codeclass="docutils literal notranslate"><spanclass="pre">TRIED</span></code>. You would learn that <codeclass="docutils literal notranslate"><spanclass="pre">E</span></code> is in the word and in the correct position, <codeclass="docutils literal notranslate"><spanclass="pre">R</span></code> is in the word but not in the correct position, and <codeclass="docutils literal notranslate"><spanclass="pre">T</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">I</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">D</span></code> are not in the word.</p>
1358
-
<p>As a different example, suppose you have guessed the words <codeclass="docutils literal notranslate"><spanclass="pre">SPADE</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">CLERK</span></code>, and you’ve learned that <codeclass="docutils literal notranslate"><spanclass="pre">E</span></code> is in the word, but not in either of those positions, and none of the other letters appear in the word.</p>
1359
-
<p>Of the words in the word list, how many could be the target word?
1360
-
Write a function called <codeclass="docutils literal notranslate"><spanclass="pre">check_word</span></code> that takes a five-letter word and checks whether it could be the target word.</p>
1357
+
<p>For example, suppose the target word is <codeclass="docutils literal notranslate"><spanclass="pre">MOWER</span></code> and you guess <codeclass="docutils literal notranslate"><spanclass="pre">TRIED</span></code>.
1358
+
You would learn that <codeclass="docutils literal notranslate"><spanclass="pre">E</span></code> is in the word and in the correct position, <codeclass="docutils literal notranslate"><spanclass="pre">R</span></code> is in the word but not in the correct position, and <codeclass="docutils literal notranslate"><spanclass="pre">T</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">I</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">D</span></code> are not in the word.</p>
1359
+
<p>As a different example, suppose you have guessed the words <codeclass="docutils literal notranslate"><spanclass="pre">SPADE</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">CLERK</span></code>, and you’ve learned that <codeclass="docutils literal notranslate"><spanclass="pre">E</span></code> is in the word, but not in either of those positions, and none of the other letters appear in the word.
1360
+
Of the words in the word list, how many could be the target word?
1361
+
Write a function called <codeclass="docutils literal notranslate"><spanclass="pre">check_word</span></code> that takes a five-letter word and checks whether it could be the target word, given these guesses.</p>
1361
1362
<p>You can use any of the functions from the previous chapter, like <codeclass="docutils literal notranslate"><spanclass="pre">uses_any</span></code>.</p>
<p><em>The Count of Monte Cristo</em> is a novel by Alexandre Dumas that is considered a classic.
1370
1371
Nevertheless, in the introduction of an English translation of the book, the writer Umberto Eco confesses that he found the book to be “one of the most badly written novels of all time”.</p>
1371
1372
<p>In particular, he says it is “shameless in its repetition of the same adjective,” and mentions in particular the number of times “its characters either shudder or turn pale.”</p>
1372
-
<p>To see whether his objection is valid, let’s count the number number of times the word <codeclass="docutils literal notranslate"><spanclass="pre">pale</span></code> appears in any form, including <codeclass="docutils literal notranslate"><spanclass="pre">pale</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">pales</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">paled</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">paleness</span></code>, as well as the related word <codeclass="docutils literal notranslate"><spanclass="pre">pallor</span></code>.
1373
+
<p>To see whether his objection is valid, let’s count the number number of lines that contain the word <codeclass="docutils literal notranslate"><spanclass="pre">pale</span></code> in any form, including <codeclass="docutils literal notranslate"><spanclass="pre">pale</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">pales</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">paled</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">paleness</span></code>, as well as the related word <codeclass="docutils literal notranslate"><spanclass="pre">pallor</span></code>.
1373
1374
Use a single regular expression that matches all of these words and no others.</p>
0 commit comments