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/chap04.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1581,7 +1581,7 @@
1581
1581
"id": "8b8faaf6",
1582
1582
"metadata": {},
1583
1583
"source": [
1584
-
"## Exercise\n",
1584
+
"### Exercise\n",
1585
1585
"\n",
1586
1586
"Write a function called `rhombus` that draws a rhombus with a given side length and a given interior angle. For example, here's a rhombus with side length `50` and an interior angle of `60` degrees."
<h2><spanclass="section-number">4.12.</span>Exercise<aclass="headerlink" href="#id1" title="Link to this heading">#</a></h2>
1276
+
<h3><spanclass="section-number">4.11.2.</span>Exercise<aclass="headerlink" href="#id1" title="Link to this heading">#</a></h3>
1280
1277
<p>Write a function called <codeclass="docutils literal notranslate"><spanclass="pre">rhombus</span></code> that draws a rhombus with a given side length and a given interior angle. For example, here’s a rhombus with side length <codeclass="docutils literal notranslate"><spanclass="pre">50</span></code> and an interior angle of <codeclass="docutils literal notranslate"><spanclass="pre">60</span></code> degrees.</p>
<h3><spanclass="section-number">4.12.1. </span>Exercise<aclass="headerlink" href="#id2" title="Link to this heading">#</a></h3>
1301
+
<h3><spanclass="section-number">4.11.3. </span>Exercise<aclass="headerlink" href="#id2" title="Link to this heading">#</a></h3>
1304
1302
<p>Now write a more general function called <codeclass="docutils literal notranslate"><spanclass="pre">parallelogram</span></code> that draws a quadrilateral with parallel sides. Then rewrite <codeclass="docutils literal notranslate"><spanclass="pre">rectangle</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">rhombus</span></code> to use <codeclass="docutils literal notranslate"><spanclass="pre">parallelogram</span></code>.</p>
<h3><spanclass="section-number">4.12.2. </span>Exercise<aclass="headerlink" href="#id3" title="Link to this heading">#</a></h3>
1342
+
<h3><spanclass="section-number">4.11.4. </span>Exercise<aclass="headerlink" href="#id3" title="Link to this heading">#</a></h3>
1345
1343
<p>Write an appropriately general set of functions that can draw shapes like this.</p>
1346
1344
<p>Hint: Write a function called <codeclass="docutils literal notranslate"><spanclass="pre">triangle</span></code> that draws one triangular segment, and then a function called <codeclass="docutils literal notranslate"><spanclass="pre">draw_pie</span></code> that uses <codeclass="docutils literal notranslate"><spanclass="pre">triangle</span></code>.</p>
<h3><spanclass="section-number">4.12.3. </span>Exercise<aclass="headerlink" href="#id4" title="Link to this heading">#</a></h3>
1468
+
<h3><spanclass="section-number">4.11.5. </span>Exercise<aclass="headerlink" href="#id4" title="Link to this heading">#</a></h3>
1471
1469
<p>Write an appropriately general set of functions that can draw flowers like this.</p>
1472
1470
<p>Hint: Use <codeclass="docutils literal notranslate"><spanclass="pre">arc</span></code> to write a function called <codeclass="docutils literal notranslate"><spanclass="pre">petal</span></code> that draws one flower petal.</p>
<h3><spanclass="section-number">4.12.4. </span>Ask a virtual assistant<aclass="headerlink" href="#ask-a-virtual-assistant" title="Link to this heading">#</a></h3>
3406
+
<h3><spanclass="section-number">4.11.6. </span>Ask a virtual assistant<aclass="headerlink" href="#ask-a-virtual-assistant" title="Link to this heading">#</a></h3>
3409
3407
<p>There are several modules like <codeclass="docutils literal notranslate"><spanclass="pre">jupyturtle</span></code> in Python, and the one we used in this chapter has been customized for this book.
3410
3408
So if you ask a virtual assistant for help, it won’t know which module to use.
3411
3409
But if you give it a few examples to work with, it can probably figure it out.
0 commit comments