Skip to content

Commit af6435b

Browse files
committed
Updating the notebooks
1 parent dfba676 commit af6435b

6 files changed

Lines changed: 57 additions & 179 deletions

File tree

chapters/chap13.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,9 +1587,7 @@
15871587
{
15881588
"cell_type": "markdown",
15891589
"id": "85844afb",
1590-
"metadata": {
1591-
"tags": []
1592-
},
1590+
"metadata": {},
15931591
"source": [
15941592
"Here's an outline of the function to get you started."
15951593
]
@@ -1601,7 +1599,10 @@
16011599
"metadata": {},
16021600
"outputs": [],
16031601
"source": [
1604-
"# Solution goes here"
1602+
"def replace_all(old, new, source_path, dest_path):\n",
1603+
" # read the contents of the source file\n",
1604+
" # replace the old string with the new\n",
1605+
" # write the result into the destination file"
16051606
]
16061607
},
16071608
{

chapters/chap14.ipynb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
"metadata": {},
360360
"source": [
361361
"It might be surprising that the parameters have the same names as the attributes, but that's a common way to write a function like this.\n",
362-
"Here's how we use `make_time` to create a `Time` object.`"
362+
"Here's how we use `make_time` to create a `Time` object."
363363
]
364364
},
365365
{
@@ -981,7 +981,7 @@
981981
"metadata": {},
982982
"source": [
983983
"The result is the number of seconds since the beginning of the day.\n",
984-
"For example, `01:01:01` is `1` hour, `1` minute and `1` second from the beginning of the day, with is the sum of `3600` seconds, `60` seconds, and `1` second."
984+
"For example, `01:01:01` is `1` hour, `1` minute and `1` second from the beginning of the day, which is the sum of `3600` seconds, `60` seconds, and `1` second."
985985
]
986986
},
987987
{
@@ -1307,14 +1307,6 @@
13071307
"Also, in this chapter we saw one example of a format specifier. For more information, ask \"What format specifiers can be used in a Python f-string?\""
13081308
]
13091309
},
1310-
{
1311-
"cell_type": "markdown",
1312-
"id": "c85eab62",
1313-
"metadata": {},
1314-
"source": [
1315-
"## Exercises\n"
1316-
]
1317-
},
13181310
{
13191311
"cell_type": "markdown",
13201312
"id": "bcdab7d6",

chapters/chap15.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,9 @@
983983
"\n",
984984
"2. Write an `__init__` method that takes `year`, `month`, and `day` as parameters and assigns the parameters to attributes. Create an object that represents June 22, 1933.\n",
985985
"\n",
986-
"2. Write `__str__` method that uses an f-string to format the attributes and returns the result. If you test it with the `Date` you created, the result should be `1933-06-22`.\n",
986+
"3. Write `__str__` method that uses an f-string to format the attributes and returns the result. If you test it with the `Date` you created, the result should be `1933-06-22`.\n",
987987
"\n",
988-
"3. Write a method called `is_after` that takes two `Date` objects and returns `True` if the first comes after the second. Create a second object that represents September 17, 1933, and check whether it comes after the first object.\n",
988+
"4. Write a method called `is_after` that takes two `Date` objects and returns `True` if the first comes after the second. Create a second object that represents September 17, 1933, and check whether it comes after the first object.\n",
989989
"\n",
990990
"Hint: You might find it useful write a method called `to_tuple` that returns a tuple that contains the attributes of a `Date` object in year-month-day order."
991991
]

0 commit comments

Comments
 (0)