From cbe09857389dd468b303278367dd610bf1baa2ec Mon Sep 17 00:00:00 2001 From: Dave Whipp Date: Wed, 2 Oct 2024 11:50:52 +0300 Subject: [PATCH] Minor edit once again --- source/part1/chapter-02/nb/00-python-basics.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/part1/chapter-02/nb/00-python-basics.ipynb b/source/part1/chapter-02/nb/00-python-basics.ipynb index c665473f..32ea3797 100644 --- a/source/part1/chapter-02/nb/00-python-basics.ipynb +++ b/source/part1/chapter-02/nb/00-python-basics.ipynb @@ -1196,7 +1196,7 @@ "tags": [] }, "source": [ - "As you can see, `float()` converts a character string to a decimal value representing the number stored in the string. `float()` can be used to convert strings or integers to floating point numbers, however `float()` can only convert strings that represent numerical values. For example, `float(\"Cold\")` will raise a `ValueError` because `\"Cold\"` cannot be converted to a number directly. In our case, however, we can now easily calculate the difference between the forecast high temperature `forecastHigh` and `tempFahrenheit` as the data are now compatible." + "As you can see, `float()` converts a character string to a decimal value representing the number stored in the string. As a result, we can now easily calculate the difference between the forecast high temperature `forecastHigh` and `tempFahrenheit` as the data are now compatible." ] }, { @@ -1223,7 +1223,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Similar to `float()`, `str()` can convert numbers to character strings, and `int()` can be used to convert strings or floating point numbers to integers. For example, we could convert `tempFahrenheit` to an integer as follows." + "`float()` can be used to convert strings or integers to floating point numbers, however it is important to note that `float()` can only convert strings that represent numerical values. For example, `float(\"Cold\")` will raise a `ValueError` because `\"Cold\"` cannot be converted to a number directly. Similar to `float()`, `str()` can convert numbers to character strings, and `int()` can be used to convert strings or floating point numbers to integers. For example, we could convert `tempFahrenheit` to an integer as follows." ] }, {