Skip to content

Commit 198899e

Browse files
committed
Update documentation
1 parent cfd77e8 commit 198899e

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

_sources/chap00.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
"name": "python",
252252
"nbconvert_exporter": "python",
253253
"pygments_lexer": "ipython3",
254-
"version": "3.10.14"
254+
"version": "3.10.11"
255255
}
256256
},
257257
"nbformat": 4,

_sources/chap01.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@
223223
"source": [
224224
"Notice that the result of the division is `42.0` rather than `42`. That's because there are two types of numbers in Python: \n",
225225
"\n",
226-
"* **integers**, which represent whole numbers, and \n",
226+
"* **integers**, which represent numbers with no fractional or decimal part, and \n",
227227
"\n",
228-
"* **floating-point numbers**, which represent numbers with a decimal point.\n",
228+
"* **floating-point numbers**, which represent integers and numbers with a decimal point.\n",
229229
"\n",
230230
"If you add, subtract, or multiply two integers, the result is an integer.\n",
231231
"But if you divide two integers, the result is a floating-point number.\n",
@@ -464,7 +464,7 @@
464464
"## Arithmetic functions\n",
465465
"\n",
466466
"In addition to the arithmetic operators, Python provides a few **functions** that work with numbers.\n",
467-
"For example, the `round` function takes a floating-point number and rounds it off to the nearest whole number."
467+
"For example, the `round` function takes a floating-point number and rounds it off to the nearest integer."
468468
]
469469
},
470470
{
@@ -845,7 +845,7 @@
845845
"source": [
846846
"The other arithmetic operators don't work with strings.\n",
847847
"\n",
848-
"Python provides a function called `len` that computes the length of a string.`"
848+
"Python provides a function called `len` that computes the length of a string."
849849
]
850850
},
851851
{
@@ -1388,10 +1388,10 @@
13881388
"A symbol, like `+` and `*`, that denotes an arithmetic operation like addition or multiplication.\n",
13891389
"\n",
13901390
"**integer:**\n",
1391-
"A type that represents whole numbers.\n",
1391+
"A type that represents numbers with no fractional or decimal part.\n",
13921392
"\n",
13931393
"**floating-point:**\n",
1394-
"A type that represents numbers with fractional parts.\n",
1394+
"A type that represents integers and numbers with decimal parts.\n",
13951395
"\n",
13961396
"**integer division:**\n",
13971397
"An operator, `//`, that divides two numbers and rounds down to an integer.\n",
@@ -1501,7 +1501,7 @@
15011501
"\n",
15021502
"* I also mentioned the order of operations. For more details, ask \"What is the order of operations in Python?\"\n",
15031503
"\n",
1504-
"* The `round` function, which we used to round a floating-point number to the nearest whole number, can take a second argument. Try asking \"What are the arguments of the round function?\" or \"How do I round pi off to three decimal places?\"\n",
1504+
"* The `round` function, which we used to round a floating-point number to the nearest integer, can take a second argument. Try asking \"What are the arguments of the round function?\" or \"How do I round pi off to three decimal places?\"\n",
15051505
"\n",
15061506
"* There's one more arithmetic operator I didn't mention; try asking \"What is the modulus operator in Python?\""
15071507
]

chap01.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ <h2><span class="section-number">1.1. </span>Arithmetic operators<a class="heade
464464
</div>
465465
<p>Notice that the result of the division is <code class="docutils literal notranslate"><span class="pre">42.0</span></code> rather than <code class="docutils literal notranslate"><span class="pre">42</span></code>. That’s because there are two types of numbers in Python:</p>
466466
<ul class="simple">
467-
<li><p><strong>integers</strong>, which represent whole numbers, and</p></li>
468-
<li><p><strong>floating-point numbers</strong>, which represent numbers with a decimal point.</p></li>
467+
<li><p><strong>integers</strong>, which represent numbers with no fractional or decimal part, and</p></li>
468+
<li><p><strong>floating-point numbers</strong>, which represent integers and numbers with a decimal point.</p></li>
469469
</ul>
470470
<p>If you add, subtract, or multiply two integers, the result is an integer.
471471
But if you divide two integers, the result is a floating-point number.
@@ -579,7 +579,7 @@ <h2><span class="section-number">1.2. </span>Expressions<a class="headerlink" hr
579579
<section id="arithmetic-functions">
580580
<h2><span class="section-number">1.3. </span>Arithmetic functions<a class="headerlink" href="#arithmetic-functions" title="Link to this heading">#</a></h2>
581581
<p>In addition to the arithmetic operators, Python provides a few <strong>functions</strong> that work with numbers.
582-
For example, the <code class="docutils literal notranslate"><span class="pre">round</span></code> function takes a floating-point number and rounds it off to the nearest whole number.</p>
582+
For example, the <code class="docutils literal notranslate"><span class="pre">round</span></code> function takes a floating-point number and rounds it off to the nearest integer.</p>
583583
<div class="cell docutils container">
584584
<div class="cell_input docutils container">
585585
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="nb">round</span><span class="p">(</span><span class="mf">42.4</span><span class="p">)</span>
@@ -752,7 +752,7 @@ <h2><span class="section-number">1.4. </span>Strings<a class="headerlink" href="
752752
</div>
753753
</div>
754754
<p>The other arithmetic operators don’t work with strings.</p>
755-
<p>Python provides a function called <code class="docutils literal notranslate"><span class="pre">len</span></code> that computes the length of a string.`</p>
755+
<p>Python provides a function called <code class="docutils literal notranslate"><span class="pre">len</span></code> that computes the length of a string.</p>
756756
<div class="cell docutils container">
757757
<div class="cell_input docutils container">
758758
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="nb">len</span><span class="p">(</span><span class="s1">&#39;Spam&#39;</span><span class="p">)</span>
@@ -999,9 +999,9 @@ <h2><span class="section-number">1.8. </span>Glossary<a class="headerlink" href=
999999
<p><strong>arithmetic operator:</strong>
10001000
A symbol, like <code class="docutils literal notranslate"><span class="pre">+</span></code> and <code class="docutils literal notranslate"><span class="pre">*</span></code>, that denotes an arithmetic operation like addition or multiplication.</p>
10011001
<p><strong>integer:</strong>
1002-
A type that represents whole numbers.</p>
1002+
A type that represents numbers with no fractional or decimal part.</p>
10031003
<p><strong>floating-point:</strong>
1004-
A type that represents numbers with fractional parts.</p>
1004+
A type that represents integers and numbers with decimal parts.</p>
10051005
<p><strong>integer division:</strong>
10061006
An operator, <code class="docutils literal notranslate"><span class="pre">//</span></code>, that divides two numbers and rounds down to an integer.</p>
10071007
<p><strong>expression:</strong>
@@ -1064,7 +1064,7 @@ <h3><span class="section-number">1.9.1. </span>Ask a virtual assistant<a class="
10641064
<ul class="simple">
10651065
<li><p>Earlier I mentioned bitwise operators but I didn’t explain why the value of <code class="docutils literal notranslate"><span class="pre">7</span> <span class="pre">^</span> <span class="pre">2</span></code> is 5. Try asking “What are the bitwise operators in Python?” or “What is the value of <code class="docutils literal notranslate"><span class="pre">7</span> <span class="pre">XOR</span> <span class="pre">2</span></code>?”</p></li>
10661066
<li><p>I also mentioned the order of operations. For more details, ask “What is the order of operations in Python?”</p></li>
1067-
<li><p>The <code class="docutils literal notranslate"><span class="pre">round</span></code> function, which we used to round a floating-point number to the nearest whole number, can take a second argument. Try asking “What are the arguments of the round function?” or “How do I round pi off to three decimal places?”</p></li>
1067+
<li><p>The <code class="docutils literal notranslate"><span class="pre">round</span></code> function, which we used to round a floating-point number to the nearest integer, can take a second argument. Try asking “What are the arguments of the round function?” or “How do I round pi off to three decimal places?”</p></li>
10681068
<li><p>There’s one more arithmetic operator I didn’t mention; try asking “What is the modulus operator in Python?”</p></li>
10691069
</ul>
10701070
<p>Most virtual assistants know about Python, so they answer questions like this pretty reliably.

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)