This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2022/dev/Debian) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode (./cs20-thinkcspy.tex LaTeX2e <2021-11-15> patch level 1 L3 programming layer <2022-01-21> (/usr/share/texlive/texmf-dist/tex/latex/base/book.cls Document Class: book 2021/10/04 v1.4n Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty))) (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty) (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/generic/iftex/ifxetex.sty) (/usr/share/texlive/texmf-dist/tex/generic/iftex/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def))) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/svgnam.def)) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/pgf.revision.tex))) (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.de f)))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code. tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet ric.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod e.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari thmetics.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct. code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.c ode.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformation s.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.t ex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code. tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.te x) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.c ode.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex)) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex ) (/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65 .sty) (/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18 .sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty) (/usr/share/texlive/texmf-dist/tex/latex/environ/environ.sty (/usr/share/texlive/texmf-dist/tex/latex/trimspaces/trimspaces.sty))) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex Library (tcolorbox): 'tcbskins.code.tex' version '5.0.2' (/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/math/pgfmath.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibrarytopaths.code.tex))) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcbskinsjigsaw.code.tex Library (tcolorbox): 'tcbskinsjigsaw.code.tex' version '5.0.2' )) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex Library (tcolorbox): 'tcbbreakable.code.tex' version '5.0.2' (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdfcol.sty (/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty))) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcbraster.code.tex Library (tcolorbox): 'tcbraster.code.tex' version '5.0.2' ) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcbxparse.code.tex Library (tcolorbox): 'tcbxparse.code.tex' version '5.0.2' (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-xetex.def (|extractbb --version))))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibrarycalc.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/xstring/xstring.sty (/usr/share/texlive/texmf-dist/tex/generic/xstring/xstring.tex)) (/usr/share/texlive/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/realscripts/realscripts.sty) (/usr/share/texlive/texmf-dist/tex/latex/metalogo/metalogo.sty)) (/usr/share/texlive/texmf-dist/tex/latex/inconsolata/zi4.sty `inconsolata-zi4' v1.12, 2019/05/17 Text macros for Inconsolata (msharpe) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty) LaTeX hooks Warning: Generic hook 'file/after/tracklang.sty' is deprecated. (hooks) Use hook 'file/tracklang.sty/after' instead. LaTeX hooks Warning: Generic hook 'package/after/bidi' is deprecated. (hooks) Use hook 'package/bidi/after' instead. LaTeX hooks Warning: Generic hook 'package/after/luabidi' is deprecated. (hooks) Use hook 'package/luabidi/after' instead. (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) Package polyglossia Warning: No hyphenation patterns were loaded for "US Englis h Max" (polyglossia) I will use the standard patterns for US English in stead on input line 202. (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype-xetex.def) (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.cfg)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amscd.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titleps.sty)) (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titletoc.sty) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex Library (tcolorbox): 'tcblistings.code.tex' version '5.0.2' (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty (/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg)) (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcblistingscore.code.tex Library (tcolorbox): 'tcblistingscore.code.tex' version '5.0.2' (/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcbprocessing.code.tex Library (tcolorbox): 'tcbprocessing.code.tex' version '5.0.2' (/usr/share/texlive/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/shellesc.sty)))) (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty) (/usr/share/texlive/texmf-dist/tex/latex/enumitem/enumitem.sty) (/usr/share/texlive/texmf-dist/tex/latex/imakeidx/imakeidx.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty)) Writing index file cs20-thinkcspy.idx (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty) (/usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty) (/usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty) (/usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty) (/usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty) (/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref-langpatches.def) (/usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty) (/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty) (/usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty (/usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty)) (/usr/share/texlive/texmf-dist/tex/latex/base/atbegshi-ltx.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/stringenc/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty (/usr/share/texlive/texmf-dist/tex/latex/base/atveryend-ltx.sty) (/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty))) (/usr/share/texlive/texmf-dist/tex/latex/extpfeil/extpfeil.sty (/usr/share/texlive/texmf-dist/tex/latex/mathtools/mathtools.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty) (/usr/share/texlive/texmf-dist/tex/latex/mathtools/mhsetup.sty)) (/usr/share/texlive/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty)) (/usr/share/texlive/texmf-dist/tex/latex/menukeys/menukeys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibraryshapes.symbols.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape s.symbols.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibraryshadows.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibraryfadings.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code .tex))) (/usr/share/texlive/texmf-dist/tex/latex/adjustbox/adjustbox.sty (/usr/share/texlive/texmf-dist/tex/latex/adjustbox/adjcalc.sty) (/usr/share/texlive/texmf-dist/tex/latex/adjustbox/trimclip.sty (/usr/share/texlive/texmf-dist/tex/latex/collectbox/collectbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/adjustbox/tc-xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty)) (/usr/share/texlive/texmf-dist/tex/latex/relsize/relsize.sty)) No file cs20-thinkcspy.aux. (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) *geometry* driver: auto-detecting *geometry* detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty) (/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty)) Package hyperref Warning: Rerun to get /PageLabels entry. [1] [2] [3] ************************************************ Preface Change Log ************************************************ (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/microtype/mt-msa.cfg) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/share/texlive/texmf-dist/tex/latex/microtype/mt-msb.cfg) (/usr/share/texlive/texmf-dist/tex/latex/stmaryrd/Ustmry.fd) (/usr/share/texlive/texmf-dist/tex/latex/microtype/mt-cmr.cfg) ************************************************ Preface Preface to the Computer Science 020 Edition ************************************************ [4] ************************************************ Preface Preface to the First and Second Editions ************************************************ [5] [6] [7] (/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty) (./cs20-thinkcspy.listing) (/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty) (./cs20-thinkcspy.listing) [8] ************************************************ Preface Preface to the Interactive Edition ************************************************ [9] [10] [11] ************************************************ Chapter 1 General Introduction ************************************************ Chapter 1. ************************************************ Section 1.1 The Way of the Program ************************************************ ************************************************ Section 1.2 Algorithms ************************************************ [1] ************************************************ Section 1.3 Computer Hardware Architecture ************************************************ [2] [3] Overfull \hbox (102.09999pt too wide) in paragraph at lines 1095--1103 [] Overfull \hbox (102.09999pt too wide) in paragraph at lines 1107--1115 [] ************************************************ Section 1.4 The Python Programming Language ************************************************ [4] (./cs20-thinkcspy.listing) [5] ************************************************ Section 1.5 Executing Python in this Book ************************************************ (./cs20-thinkcspy.listing) [6] LaTeX Warning: Hyper reference `section-simple-python-data_variables' on page 7 undefined on input line 1246. LaTeX Warning: Reference `section-simple-python-data_variables' on page 7 undef ined on input line 1246. (./cs20-thinkcspy.listing) [7] ************************************************ Section 1.6 Writing Assignments\textemdash {}The Thonny IDE ************************************************ [8] LaTeX Warning: Hyper reference `figure-general-intro-fig_thonny' on page 9 unde fined on input line 1321. LaTeX Warning: Reference `figure-general-intro-fig_thonny' on page 9 undefined on input line 1321. ************************************************ Section 1.7 A Typical First Program ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [9] ************************************************ Section 1.8 More About Programs ************************************************ [10] ************************************************ Section 1.9 What is Debugging? ************************************************ [11] ************************************************ Section 1.10 Syntax errors ************************************************ [12] ************************************************ Section 1.11 Let's Make Mistakes! ************************************************ (./cs20-thinkcspy.listing) [13] ************************************************ Section 1.12 Runtime Errors ************************************************ [14] ************************************************ Section 1.13 Semantic Errors ************************************************ Overfull \hbox (1.03pt too wide) in paragraph at lines 1684--1685 []\TU/lmr/m/n/10 This will produce the wrong answer because the programmer impl emented [15] ************************************************ Section 1.14 Experimental Debugging ************************************************ [16] ************************************************ Section 1.15 Comments ************************************************ [17] (./cs20-thinkcspy.listing LaTeX Font Warning: Font shape `TS1/Inconsolatazi4-Regular.otf(0)/m/n' undefine d (Font) using `TS1/cmr/m/n' instead (Font) for symbol `textquotesingle' on input line 7. ) ************************************************ Section 1.16 Formal and Natural Languages ************************************************ [18] ************************************************ Glossary 1.16 Glossary ************************************************ [19] ************************************************ Glossary 1.16 Glossary ************************************************ [20] ************************************************ Section 1.17 Glossary ************************************************ ************************************************ Glossary 1.17 Glossary ************************************************ [21] ************************************************ Exercises 1.18 Exercises ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [22] ************************************************ Chapter 2 Simple Python Data ************************************************ [23] Chapter 2. ************************************************ Section 2.1 Variables, Expressions and Statements ************************************************ ************************************************ Section 2.2 Values and Data Types ************************************************ (./cs20-thinkcspy.listing) Overfull \hbox (44.39pt too wide) in paragraph at lines 2134--2135 \TU/lmr/m/n/10 that a program manipulates. The values in this program are []\TU /Inconsolatazi4-Regular.otf(0)/m/n/10 My age in days is about[]\TU/lmr/m/n/10 , (./cs20-thinkcspy.listing) [24] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [25] ************************************************ Section 2.3 Variables ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [26] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [27] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [28] ************************************************ Section 2.4 Variable Names and Keywords ************************************************ [29] ************************************************ Section 2.5 Choosing Variable Names ************************************************ Overfull \hbox (53.68503pt too wide) in paragraph at lines 2432--2433 \TU/lmr/m/n/10 ful names for your variables. (But don’t go overboard: \TU/Incon solatazi4-Regular.otf(0)/m/n/10 age_in_years_as_of_last_birthday ************************************************ Section 2.6 Statements and Expressions ************************************************ (./cs20-thinkcspy.listing) [30] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 2.7 Operators and Operands ************************************************ (./cs20-thinkcspy.listing) [31] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [32] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [33] ************************************************ Section 2.8 Planning a Program ************************************************ LaTeX Warning: Hyper reference `section-simple-python-data_order-of-operations' on page 34 undefined on input line 2658. LaTeX Warning: Reference `section-simple-python-data_order-of-operations' on pa ge 34 undefined on input line 2658. [34] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 2.9 Input ************************************************ (./cs20-thinkcspy.listing) [35] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 2.10 Type Conversion Functions ************************************************ (./cs20-thinkcspy.listing) [36] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [37] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 2.11 Using Input in a Program ************************************************ (./cs20-thinkcspy.listing) [38] (./cs20-thinkcspy.listing) ************************************************ Section 2.12 Order of Operations ************************************************ [39] (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-appendices_operator-precedence-table' o n page 40 undefined on input line 2958. LaTeX Warning: Reference `section-appendices_operator-precedence-table' on page 40 undefined on input line 2958. (./cs20-thinkcspy.listing) [40] (./cs20-thinkcspy.listing) ************************************************ Section 2.13 More About Strings ************************************************ (./cs20-thinkcspy.listing) [41] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 2.14 Reassignment ************************************************ (./cs20-thinkcspy.listing) [42] (./cs20-thinkcspy.listing) ************************************************ Subsection 2.14.1 Developing your Mental Model of How Python Evaluates ************************************************ Overfull \hbox (0.58401pt too wide) in paragraph at lines 3108--3108 |[]\TU/lmr/bx/n/12 Developing your Mental Model of How Python Eval- (./cs20-thinkcspy.listing) [43] ************************************************ Section 2.15 Updating Variables ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [44] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [45] (./cs20-thinkcspy.listing) ************************************************ Section 2.16 Updating Variables: Compound Assignment ************************************************ Overfull \hbox (5.26147pt too wide) in paragraph at lines 3287--3287 |[]\TU/lmr/bx/n/14.4 Updating Variables: Compound Assignment| (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `table-table_compound_assignments' on page 46 un defined on input line 3299. LaTeX Warning: Reference `table-table_compound_assignments' on page 46 undefine d on input line 3299. [46] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 2.17 Glossary ************************************************ ************************************************ Glossary 2.17 Glossary ************************************************ (./cs20-thinkcspy.listing) [47] [48] ************************************************ Exercises 2.18 Exercises ************************************************ (./cs20-thinkcspy.listing) [49] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [50] Package amsmath Warning: Foreign command \over; (amsmath) \frac or \genfrac should be used instead (amsmath) on input line 3552. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [51] (./cs20-thinkcspy.listing) ************************************************ Chapter 3 Debugging Interlude 1 ************************************************ [52] Chapter 3. ************************************************ Section 3.1 How to be a Successful Programmer ************************************************ ************************************************ Section 3.2 How to Avoid Debugging ************************************************ [53] LaTeX Warning: Hyper reference `exercises-simple-python-data_exercises' on page 54 undefined on input line 3667. LaTeX Warning: Reference `exercises-simple-python-data_exercises' on page 54 un defined on input line 3667. [54] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [55] (./cs20-thinkcspy.listing) ************************************************ Section 3.3 Beginning tips for Debugging ************************************************ ************************************************ Section 3.4 Know Your Error Messages ************************************************ ************************************************ Subsection 3.4.1 Introduction ************************************************ (./cs20-thinkcspy.listing) [56] (./cs20-thinkcspy.listing) [57] ************************************************ Subsection 3.4.2 ParseError ************************************************ (./cs20-thinkcspy.listing) [58] (./cs20-thinkcspy.listing) [59] ************************************************ Subsection 3.4.3 TypeError ************************************************ (./cs20-thinkcspy.listing) Overfull \hbox (4.90839pt too wide) in paragraph at lines 3941--3942 \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 unsupported operand type(s) for FloorD iv: \TS1/Inconsolatazi4-Regular.otf(0)/m/n/10 '\TU/Inconsolatazi4-Regular.otf(0 )/m/n/10 str\TS1/Inconsolatazi4-Regular.otf(0)/m/n/10 ' \TU/Inconsolatazi4-Regu lar.otf(0)/m/n/10 and \TS1/Inconsolatazi4-Regular.otf(0)/m/n/10 '\TU/Inconsolat azi4-Regular.otf(0)/m/n/10 number\TS1/Inconsolatazi4-Regular.otf(0)/m/n/10 ' \T U/Inconsolatazi4-Regular.otf(0)/m/n/10 on line: 5 Overfull \hbox (0.12201pt too wide) in paragraph at lines 3946--3947 []\TU/lmr/m/n/10 The assignment statement \TU/Inconsolatazi4-Regular.otf(0)/m/n /10 x = int(x) \TU/lmr/m/n/10 is very different. Again, the \TU/Inconsolatazi4- Regular.otf(0)/m/n/10 int(x) [60] ************************************************ Subsection 3.4.4 NameError ************************************************ (./cs20-thinkcspy.listing) [61] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [62] ************************************************ Subsection 3.4.5 ValueError ************************************************ (./cs20-thinkcspy.listing) ************************************************ Section 3.5 Summary ************************************************ [63] ************************************************ Exercises 3.6 Exercises ************************************************ ************************************************ Chapter 4 Conditionals ************************************************ [64] Chapter 4. ************************************************ Section 4.1 Making Decisions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [65] [66] ************************************************ Section 4.2 Conditional Execution: Binary Selection ************************************************ (./cs20-thinkcspy.listing) [67] (./cs20-thinkcspy.listing) [68] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [69] ************************************************ Section 4.3 Omitting the else Clause: Unary Selection ************************************************ (./cs20-thinkcspy.listing) [70] LaTeX Warning: Hyper reference `section-conditionals_conditional-execution-bina ry-selection' on page 71 undefined on input line 4405. LaTeX Warning: Reference `section-conditionals_conditional-execution-binary-sel ection' on page 71 undefined on input line 4405. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [71] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 4.4 Logical operators ************************************************ LaTeX Warning: Hyper reference `section-conditionals_boolean-values-and-boolean -expressions' on page 72 undefined on input line 4512. LaTeX Warning: Reference `section-conditionals_boolean-values-and-boolean-expre ssions' on page 72 undefined on input line 4512. [72] (./cs20-thinkcspy.listing) [73] ************************************************ Section 4.5 Logical operators\textemdash {}Advanced Topics ************************************************ [74] [75] ************************************************ Subsection 4.5.1 Logical Opposites ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 4.5.2 The deMorgan Laws ************************************************ (./cs20-thinkcspy.listing) [76] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 4.6 Precedence of Operators ************************************************ [77] LaTeX Warning: Hyper reference `section-appendices_operator-precedence-table' o n page 78 undefined on input line 4798. LaTeX Warning: Reference `section-appendices_operator-precedence-table' on page 78 undefined on input line 4798. ************************************************ Section 4.7 Chained conditionals ************************************************ [78] (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `figure-fig_chained_elif' on page 79 undefined o n input line 4880. LaTeX Warning: Reference `figure-fig_chained_elif' on page 79 undefined on inpu t line 4880. (./cs20-thinkcspy.listing) [79] (./cs20-thinkcspy.listing) [80] (./cs20-thinkcspy.listing) [81] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [82] ************************************************ Section 4.8 Nested conditionals ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [83] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [84] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [85] ************************************************ Section 4.9 ``Short-circuit'' Evaluation of Logical Expressions ************************************************ (./cs20-thinkcspy.listing) [86] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [87] Overfull \hbox (644.63005pt too wide) in paragraph at lines 5361--5367 [] Overfull \hbox (644.63005pt too wide) in paragraph at lines 5371--5377 [] ************************************************ Section 4.10 Glossary ************************************************ ************************************************ Glossary 4.10 Glossary ************************************************ [88] Overfull \hbox (0.60172pt too wide) in paragraph at lines 5406--5408 []\TU/lmr/bx/n/10 boolean value []\TU/lmr/m/n/10 There are exactly two boolean values: \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 True \TU/lmr/m/n/10 and \TU/In consolatazi4-Regular.otf(0)/m/n/10 False\TU/lmr/m/n/10 . Boolean ************************************************ Exercises 4.11 Exercises ************************************************ [89] [90] [91] LaTeX Warning: Hyper reference `subsection-conditionals_de-morgan-laws' on page 92 undefined on input line 5612. LaTeX Warning: Reference `subsection-conditionals_de-morgan-laws' on page 92 un defined on input line 5612. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [92] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [93] (./cs20-thinkcspy.listing) [94] ************************************************ Section 4.12 Mixed-up Code Questions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [95] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [96] (./cs20-thinkcspy.listing) [97] (./cs20-thinkcspy.listing) ************************************************ Exercises 4.13 Write Code Questions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [98] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [99] ************************************************ Chapter 5 Loops and Iterations ************************************************ [100] Chapter 5. ************************************************ Section 5.1 What is Iteration? ************************************************ LaTeX Warning: Hyper reference `section-general-intro_more-about-programs' on p age 101 undefined on input line 6310. LaTeX Warning: Reference `section-general-intro_more-about-programs' on page 10 1 undefined on input line 6310. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [101] ************************************************ Section 5.2 The \texttt {while} statement ************************************************ (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `figure-fig_while_loop' on page 102 undefined on input line 6395. LaTeX Warning: Reference `figure-fig_while_loop' on page 102 undefined on input line 6395. [102] (./cs20-thinkcspy.listing) [103] (./cs20-thinkcspy.listing) ************************************************ Section 5.3 Using \texttt {while} ************************************************ LaTeX Warning: Hyper reference `section-iteration_the-while-statement' on page 104 undefined on input line 6462. LaTeX Warning: Reference `section-iteration_the-while-statement' on page 104 un defined on input line 6462. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [104] LaTeX Warning: Hyper reference `section-strings_formatting-strings' on page 105 undefined on input line 6535. LaTeX Warning: Reference `section-strings_formatting-strings' on page 105 undef ined on input line 6535. ************************************************ Section 5.4 ``Do Nothing'' and Infinite Loops ************************************************ [105] ************************************************ Subsection 5.4.1 \texttt {while} Loops That Do Nothing ************************************************ (./cs20-thinkcspy.listing) ************************************************ Subsection 5.4.2 Infinite Loops ************************************************ LaTeX Warning: Hyper reference `section-iteration_the-while-statement' on page 106 undefined on input line 6600. LaTeX Warning: Reference `section-iteration_the-while-statement' on page 106 un defined on input line 6600. [106] (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-general-intro_thonny_ide' on page 107 u ndefined on input line 6612. LaTeX Warning: Reference `section-general-intro_thonny_ide' on page 107 undefin ed on input line 6612. ************************************************ Subsection 5.4.3 The \texttt {break} Statement ************************************************ (./cs20-thinkcspy.listing) [107] Overfull \hbox (0.7367pt too wide) in paragraph at lines 6661--6663 []\TU/lmr/bx/n/10 Checkpoint 5.4.5 []\TU/lmr/m/n/10 Construct a block of code t hat prints the numbers 1 through (./cs20-thinkcspy.listing) ************************************************ Section 5.5 Definite loops using \texttt {for} ************************************************ [108] (./cs20-thinkcspy.listing) [109] LaTeX Warning: Hyper reference `chapter-ch-lists' on page 110 undefined on inpu t line 6796. LaTeX Warning: Reference `chapter-ch-lists' on page 110 undefined on input line 6796. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) ************************************************ Section 5.6 Loop patterns ************************************************ [110] ************************************************ Subsection 5.6.1 Counting and summing loops ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [111] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 5.6.2 Maximum and Minimum Loops ************************************************ (./cs20-thinkcspy.listing) [112] (./cs20-thinkcspy.listing) [113] (./cs20-thinkcspy.listing) ************************************************ Section 5.7 The \texttt {range} Function ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [114] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [115] (./cs20-thinkcspy.listing) [116] [117] ************************************************ Section 5.8 Debugging ************************************************ [118] ************************************************ Section 5.9 Glossary ************************************************ ************************************************ Glossary 5.9 Glossary ************************************************ [119] Overfull \hbox (537.38004pt too wide) in paragraph at lines 7386--7393 [] Overfull \hbox (537.38004pt too wide) in paragraph at lines 7397--7404 [] Overfull \hbox (203.28004pt too wide) in paragraph at lines 7410--7416 [] Overfull \hbox (203.28004pt too wide) in paragraph at lines 7420--7426 [] ************************************************ Exercises 5.10 Multiple Choice Questions ************************************************ [120] [121] [122] [123] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [124] ************************************************ Section 5.11 Write Code Questions ************************************************ [125] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [126] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [127] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [128] ************************************************ Section 5.12 Group Work - Loops (For, Range, While) ************************************************ [129] ************************************************ Subsection 5.12.1 for Statements ************************************************ (./cs20-thinkcspy.listing) [130] (./cs20-thinkcspy.listing) [131] ************************************************ Subsection 5.12.2 The range Function ************************************************ (./cs20-thinkcspy.listing) Overfull \hbox (3.78201pt too wide) in paragraph at lines 8131--8138 []\TU/lmr/m/n/10 If the argument of the \TU/Inconsolatazi4-Regular.otf(0)/m/n/1 0 range \TU/lmr/m/n/10 function specifies a single number, like \TU/Inconsolata zi4-Regular.otf(0)/m/n/10 range(x)\TU/lmr/m/n/10 , [132] [133] ************************************************ Subsection 5.12.3 while Statements ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [134] (./cs20-thinkcspy.listing) [135] (./cs20-thinkcspy.listing) [136] ************************************************ Chapter 6 Functions ************************************************ [137] Chapter 6. ************************************************ Section 6.1 Function calls ************************************************ (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-functions_type-conversion-functions' on page 138 undefined on input line 8416. LaTeX Warning: Reference `section-functions_type-conversion-functions' on page 138 undefined on input line 8416. (./cs20-thinkcspy.listing) [138] (./cs20-thinkcspy.listing) ************************************************ Section 6.2 Built-in functions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [139] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [140] ************************************************ Section 6.3 Type conversion functions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [141] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [142] ************************************************ Section 6.4 Math functions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 6.4.1 Trigonometric Functions ************************************************ [143] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) Overfull \hbox (5.41002pt too wide) in paragraph at lines 8757--8765 []\TU/lmr/m/n/10 The Python trigonometric functions do not want their arguments in degrees— (./cs20-thinkcspy.listing) ************************************************ Subsection 6.4.2 Exercises ************************************************ [144] Overfull \hbox (28.12372pt too wide) in paragraph at lines 8840--8842 []\TU/lmr/bx/n/10 Checkpoint 6.4.3 []\TU/lmr/m/n/10 Q-7: When we use the \TU/In consolatazi4-Regular.otf(0)/m/n/10 import math \TU/lmr/m/n/10 statement, a ____ ______ ************************************************ Section 6.5 Random numbers ************************************************ [145] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [146] (./cs20-thinkcspy.listing) ************************************************ Section 6.6 Adding new functions ************************************************ (./cs20-thinkcspy.listing) [147] (./cs20-thinkcspy.listing) [148] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 6.7 Why Functions? ************************************************ [149] ************************************************ Section 6.8 Repetitive Code ************************************************ (./cs20-thinkcspy.listing) [150] ************************************************ Section 6.9 Eliminating Repetitive Code ************************************************ (./cs20-thinkcspy.listing) ************************************************ Section 6.10 Flow of execution ************************************************ [151] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [152] [153] ************************************************ Section 6.11 Value-Returning Functions and Void Functions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-functions_why-functions' on page 154 un defined on input line 9474. LaTeX Warning: Reference `section-functions_why-functions' on page 154 undefine d on input line 9474. (./cs20-thinkcspy.listing) [154] Overfull \hbox (0.24002pt too wide) in paragraph at lines 9514--9515 []\TU/lmr/m/n/10 Incorrect! Value-returning functions may display something on the screen, [155] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 6.12 Docstrings ************************************************ LaTeX Warning: Hyper reference `section-functions_eliminating-repetition' on pa ge 156 undefined on input line 9568. LaTeX Warning: Reference `section-functions_eliminating-repetition' on page 156 undefined on input line 9568. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [156] ************************************************ Section 6.13 Debugging ************************************************ [157] ************************************************ Section 6.14 Glossary ************************************************ ************************************************ Glossary 6.14 Glossary ************************************************ Overfull \hbox (309.81006pt too wide) in paragraph at lines 9727--9735 [] Overfull \hbox (309.81006pt too wide) in paragraph at lines 9739--9747 [] [158] Overfull \hbox (346.70001pt too wide) in paragraph at lines 9753--9761 [] Overfull \hbox (346.70001pt too wide) in paragraph at lines 9765--9773 [] Overfull \hbox (237.32pt too wide) in paragraph at lines 9779--9786 [] Overfull \hbox (237.32pt too wide) in paragraph at lines 9790--9797 [] Overfull \hbox (231.84003pt too wide) in paragraph at lines 9803--9810 [] Overfull \hbox (231.84003pt too wide) in paragraph at lines 9814--9821 [] [159] ************************************************ Exercises 6.15 Multiple Choice Questions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [160] [161] (./cs20-thinkcspy.listing) [162] (./cs20-thinkcspy.listing) [163] (./cs20-thinkcspy.listing) [164] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [165] ************************************************ Section 6.16 Mixed-up Code Questions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [166] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [167] (./cs20-thinkcspy.listing) [168] (./cs20-thinkcspy.listing) Overfull \hbox (12.7767pt too wide) in paragraph at lines 10569--10571 []\TU/lmr/bx/n/10 Checkpoint 6.16.7 []\TU/lmr/m/n/10 Put the code blocks below to define the function \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 alarm_clock\TU/ lmr/m/n/10 . (./cs20-thinkcspy.listing) [169] (./cs20-thinkcspy.listing) [170] (./cs20-thinkcspy.listing) ************************************************ Exercises 6.17 Write Code Questions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [171] (./cs20-thinkcspy.listing Overfull \hbox (23.48332pt too wide) in paragraph at lines 11--12 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (23.48332pt too wide) in paragraph at lines 12--14 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing Overfull \hbox (77.48387pt too wide) in paragraph at lines 11--12 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (50.4836pt too wide) in paragraph at lines 12--14 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing) [172] (./cs20-thinkcspy.listing) Overfull \hbox (11.724pt too wide) in paragraph at lines 10899--10918 \TU/lmr/m/n/10 cost of a trip. It should take the \TU/Inconsolatazi4-Regular.ot f(0)/m/n/10 miles\TU/lmr/m/n/10 , \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 mile sPerGallon\TU/lmr/m/n/10 , and \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 pricePe rGallon Overfull \hbox (26.62201pt too wide) in paragraph at lines 10899--10918 \TU/lmr/m/n/10 as parameters and should return the cost of the trip. For exampl e, \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 tripCost(100, (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [173] Overfull \hbox (28.4382pt too wide) in paragraph at lines 10948--10962 \TU/lmr/m/n/10 one a score greater than 1, return \TS1/Inconsolatazi4-Regular.o tf(0)/m/n/10 '\TU/Inconsolatazi4-Regular.otf(0)/m/n/10 Bad score\TS1/Inconsolat azi4-Regular.otf(0)/m/n/10 '\TU/lmr/m/n/10 . For example, \TU/Inconsolatazi4-Re gular.otf(0)/m/n/10 compute_grade(.95) (./cs20-thinkcspy.listing Overfull \hbox (66.68376pt too wide) in paragraph at lines 10--11 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ] Overfull \hbox (66.68376pt too wide) in paragraph at lines 12--13 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ] Overfull \hbox (55.88365pt too wide) in paragraph at lines 13--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ] ) (./cs20-thinkcspy.listing Overfull \hbox (34.28343pt too wide) in paragraph at lines 10--11 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (12.68321pt too wide) in paragraph at lines 11--12 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (34.28343pt too wide) in paragraph at lines 12--13 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (18.08327pt too wide) in paragraph at lines 13--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing) [174] (./cs20-thinkcspy.listing Overfull \hbox (163.88475pt too wide) in paragraph at lines 10--11 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (23.48332pt too wide) in paragraph at lines 11--12 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (331.28645pt too wide) in paragraph at lines 12--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing) [175] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [176] ************************************************ Section 6.18 Group Work: Functions ************************************************ ************************************************ Subsection 6.18.1 Print and Function Basics ************************************************ [177] (./cs20-thinkcspy.listing) [178] (./cs20-thinkcspy.listing) ************************************************ Subsection 6.18.2 Parts of a Function and Function Calls ************************************************ (./cs20-thinkcspy.listing) Overfull \hbox (31.97003pt too wide) in paragraph at lines 11268--11270 \TU/lmr/bx/n/10 Answer\TU/lmr/m/n/10 .[] Correct: \TU/Inconsolatazi4-Regular.ot f(0)/m/n/10 def print_message():\TU/lmr/m/n/10 ; \TU/Inconsolatazi4-Regular.otf (0)/m/n/10 def main():\TU/lmr/m/n/10 . Incorrect: \TU/Inconsolatazi4-Regular.ot f(0)/m/n/10 print([]Welcome Overfull \hbox (51.53001pt too wide) in paragraph at lines 11268--11270 \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 to Python.[])\TU/lmr/m/n/10 ; \TU/Inco nsolatazi4-Regular.otf(0)/m/n/10 print([]Learn the power of functions![])\TU/lm r/m/n/10 ; \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 print([]Hello Programmer![] )\TU/lmr/m/n/10 ; (./cs20-thinkcspy.listing) Overfull \hbox (2.71005pt too wide) in paragraph at lines 11288--11290 \TU/lmr/bx/n/10 Answer\TU/lmr/m/n/10 .[] Correct: \TU/Inconsolatazi4-Regular.ot f(0)/m/n/10 print_message\TU/lmr/m/n/10 ; \TU/Inconsolatazi4-Regular.otf(0)/m/n /10 main\TU/lmr/m/n/10 . Incorrect: \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 de f\TU/lmr/m/n/10 ; \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 ():\TU/lmr/m/n/10 ; \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 print([]Welcome Overfull \hbox (25.88004pt too wide) in paragraph at lines 11288--11290 \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 to Python.[])\TU/lmr/m/n/10 ; \TU/Inco nsolatazi4-Regular.otf(0)/m/n/10 print([]Learn the power of functions![])\TU/lm r/m/n/10 ; \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 def \TU/lmr/m/n/10 ; \TU/In consolatazi4-Regular.otf(0)/m/n/10 ():\TU/lmr/m/n/10 ; \TU/Inconsolatazi4-Regul ar.otf(0)/m/n/10 print([]Hello [179] Overfull \hbox (262.86003pt too wide) in paragraph at lines 11295--11303 [] Overfull \hbox (262.86003pt too wide) in paragraph at lines 11307--11315 [] ************************************************ Subsection 6.18.3 Writing Function Calls ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [180] ************************************************ Subsection 6.18.4 Function Order ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [181] ************************************************ Subsection 6.18.5 Special Characters and Keywords ************************************************ ************************************************ Chapter 7 Strings ************************************************ [182] Chapter 7. ************************************************ Section 7.1 Strings Revisited ************************************************ Overfull \hbox (10.32pt too wide) in paragraph at lines 11537--11538 []\TU/lmr/m/n/10 Take a Windows file name like []\TU/Inconsolatazi4-Regular.otf (0)/m/n/10 C:\Users\Phuong\Documents\report.docx[] ************************************************ Section 7.2 A Collection Data Type ************************************************ ************************************************ Section 7.3 Operations on Strings ************************************************ [183] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) Overfull \hbox (14.71202pt too wide) in paragraph at lines 11603--11604 []\TU/lmr/m/n/10 With numbers, \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 print(3 * 4) \TU/lmr/m/n/10 is the same as \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 pr int(4 * 3)\TU/lmr/m/n/10 . Does \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 print( []ha[] [184] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [185] ************************************************ Section 7.4 Index Operator: Working with the Characters of a String ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [186] (./cs20-thinkcspy.listing) ************************************************ Section 7.5 Length ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [187] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [188] ************************************************ Section 7.6 The Slice Operator ************************************************ LaTeX Warning: Hyper reference `section-strings_strings-revisited' on page 189 undefined on input line 11885. LaTeX Warning: Reference `section-strings_strings-revisited' on page 189 undefi ned on input line 11885. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [189] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-strings_string-methods' on page 190 und efined on input line 11980. LaTeX Warning: Reference `section-strings_string-methods' on page 190 undefined on input line 11980. (./cs20-thinkcspy.listing) [190] ************************************************ Section 7.7 Objects and Methods ************************************************ [191] ************************************************ Section 7.8 String Methods ************************************************ (./cs20-thinkcspy.listing) Overfull \hbox (150.25003pt too wide) in paragraph at lines 12051--12073 [] [192] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [193] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 7.9 Program: Changing the Form of a Name ************************************************ LaTeX Warning: Hyper reference `section-strings_strings-revisited' on page 194 undefined on input line 12182. LaTeX Warning: Reference `section-strings_strings-revisited' on page 194 undefi ned on input line 12182. (./cs20-thinkcspy.listing) [194] (./cs20-thinkcspy.listing) [195] ************************************************ Section 7.10 Formatting Strings ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 7.10.1 f-strings ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [196] ************************************************ Subsection 7.10.2 Controlling Decimal Digits ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 7.10.3 Advanced Topic: Aligning Output ************************************************ (./cs20-thinkcspy.listing) ************************************************ Subsection 7.10.4 Advanced Topic: Additional Formatting Codes ************************************************ (./cs20-thinkcspy.listing) [197] (./cs20-thinkcspy.listing) ************************************************ Subsection 7.10.5 Exercises ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [198] ************************************************ Section 7.11 String Comparison ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [199] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [200] ************************************************ Section 7.12 Strings are Immutable ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [201] ************************************************ Section 7.13 Traversal and the \texttt {for} Loop: By Item ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [202] (./cs20-thinkcspy.listing) ************************************************ Section 7.14 Traversal and the \texttt {for} Loop: By Index ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [203] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 7.15 Traversal and the \texttt {while} Loop ************************************************ (./cs20-thinkcspy.listing) [204] (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-strings_traversal-by-item' on page 205 undefined on input line 12822. LaTeX Warning: Reference `section-strings_traversal-by-item' on page 205 undefi ned on input line 12822. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [205] ************************************************ Section 7.16 The \texttt {in} and \texttt {not in} operators ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) ************************************************ Section 7.17 The Accumulator Pattern with Strings ************************************************ LaTeX Warning: Hyper reference `subsection-iterations_counting-and-summing-loop s' on page 206 undefined on input line 12901. LaTeX Warning: Reference `subsection-iterations_counting-and-summing-loops' on page 206 undefined on input line 12901. (./cs20-thinkcspy.listing) [206] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [207] ************************************************ Section 7.18 Looping and Counting ************************************************ (./cs20-thinkcspy.listing) ************************************************ Section 7.19 A \texttt {find} function ************************************************ (./cs20-thinkcspy.listing) [208] (./cs20-thinkcspy.listing) ************************************************ Section 7.20 Optional parameters ************************************************ (./cs20-thinkcspy.listing) [209] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [210] ************************************************ Section 7.21 Character Classification ************************************************ (./cs20-thinkcspy.listing) Missing character: There is no 年 (U+5E74) in font [lmroman10-regular]:mapping=t ex-text;! (./cs20-thinkcspy.listing Missing character: There is no Δ (U+0394) in font [Inconsolatazi4-Regular.otf]/ OT:script=latn;language=dflt;+ss01;+ss03;! Missing character: There is no 年 (U+5E74) in font [Inconsolatazi4-Regular.otf]/ OT:script=latn;language=dflt;+ss01;+ss03;! ) [211] ************************************************ Section 7.22 Summary ************************************************ ************************************************ Glossary 7.22 Glossary ************************************************ (./cs20-thinkcspy.listing) [212] ************************************************ Section 7.23 Glossary ************************************************ ************************************************ Glossary 7.23 Glossary ************************************************ ************************************************ Exercises 7.24 Exercises ************************************************ [213] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [214] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [215] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [216] (./cs20-thinkcspy.listing Overfull \hbox (7.28316pt too wide) in paragraph at lines 13--14 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][] ) (./cs20-thinkcspy.listing Overfull \hbox (45.08354pt too wide) in paragraph at lines 13--14 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (45.08354pt too wide) in paragraph at lines 14--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (61.2837pt too wide) in paragraph at lines 15--18 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] ) [217] (./cs20-thinkcspy.listing Overfull \hbox (18.08327pt too wide) in paragraph at lines 13--14 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (23.48332pt too wide) in paragraph at lines 14--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] Overfull \hbox (1.8831pt too wide) in paragraph at lines 16--17 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing) [218] (./cs20-thinkcspy.listing Overfull \hbox (50.4836pt too wide) in paragraph at lines 13--14 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (61.2837pt too wide) in paragraph at lines 14--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (104.48415pt too wide) in paragraph at lines 15--16 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (77.48387pt too wide) in paragraph at lines 16--20 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing) [219] (./cs20-thinkcspy.listing Overfull \hbox (28.88338pt too wide) in paragraph at lines 14--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (50.4836pt too wide) in paragraph at lines 15--16 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (77.48387pt too wide) in paragraph at lines 16--17 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] Overfull \hbox (72.08382pt too wide) in paragraph at lines 17--21 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][] ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [220] (./cs20-thinkcspy.listing Overfull \hbox (1.8831pt too wide) in paragraph at lines 14--15 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][] Overfull \hbox (45.08354pt too wide) in paragraph at lines 15--16 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][] Overfull \hbox (18.08327pt too wide) in paragraph at lines 16--17 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][] Overfull \hbox (50.4836pt too wide) in paragraph at lines 17--18 [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][ ][][][][][] ) [221] (./cs20-thinkcspy.listing) ************************************************ Chapter 8 Interlude: The Software Development Life Cycle ************************************************ [222] Chapter 8. ************************************************ Section 8.1 Developing Small Projects ************************************************ ************************************************ Section 8.2 Developing Large Projects ************************************************ [223] Overfull \hbox (60.61996pt too wide) in paragraph at lines 13791--13791 [][]$[][][] [] [][][][][][][] [] [][][] [] [][][][][][][][] [] [][][][][][][][] [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]$ []| Overfull \hbox (32.02452pt too wide) has occurred while \output is active \TU/lmr/m/sl/10 CHAPTER 8. INTERLUDE: THE SOFTWARE DEVELOPMENT LIFE CYCLE \TU/l mr/m/n/10 224 [224] ************************************************ Chapter 9 Lists ************************************************ Overfull \hbox (32.02452pt too wide) has occurred while \output is active \TU/lmr/m/sl/10 CHAPTER 8. INTERLUDE: THE SOFTWARE DEVELOPMENT LIFE CYCLE \TU/l mr/m/n/10 225 [225] Chapter 9. ************************************************ Section 9.1 Lists ************************************************ (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-iteration_loop-patterns' on page 226 un defined on input line 13869. LaTeX Warning: Reference `section-iteration_loop-patterns' on page 226 undefine d on input line 13869. (./cs20-thinkcspy.listing) [226] ************************************************ Section 9.2 The Accumulator Pattern with Lists ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 9.2.1 Accumulating the Max Value ************************************************ (./cs20-thinkcspy.listing) ************************************************ Subsection 9.2.2 Accumulating a String Result ************************************************ [227] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [228] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [229] (./cs20-thinkcspy.listing) ************************************************ Section 9.3 List Values ************************************************ (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-lists_lists' on page 230 undefined on i nput line 14102. LaTeX Warning: Reference `section-lists_lists' on page 230 undefined on input l ine 14102. (./cs20-thinkcspy.listing) [230] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 9.4 Accessing Elements ************************************************ (./cs20-thinkcspy.listing) [231] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 9.5 List Membership ************************************************ (./cs20-thinkcspy.listing) [232] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 9.6 Concatenation and Repetition ************************************************ (./cs20-thinkcspy.listing) [233] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [234] ************************************************ Section 9.7 List Slices ************************************************ LaTeX Warning: Hyper reference `section-strings_the-slice-operator' on page 235 undefined on input line 14401. LaTeX Warning: Reference `section-strings_the-slice-operator' on page 235 undef ined on input line 14401. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [235] ************************************************ Section 9.8 Lists are Mutable ************************************************ (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-strings_strings-are-immutable' on page 236 undefined on input line 14454. LaTeX Warning: Reference `section-strings_strings-are-immutable' on page 236 un defined on input line 14454. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [236] ************************************************ Section 9.9 List Deletion ************************************************ (./cs20-thinkcspy.listing) ************************************************ Section 9.10 Programming Phase 1: Planning ************************************************ (./cs20-thinkcspy.listing) [237] ************************************************ Section 9.11 Programming Phase 2: Debugging ************************************************ (./cs20-thinkcspy.listing) ************************************************ Section 9.12 Programming Phase 3: Fixing ************************************************ ************************************************ Subsection 9.12.1 The Problem ************************************************ [238] ************************************************ Subsection 9.12.2 The Fix ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 9.12.3 The Moral of the Story ************************************************ [239] ************************************************ Section 9.13 Objects, References, and Aliasing ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [240] (./cs20-thinkcspy.listing) ************************************************ Section 9.14 Cloning Lists ************************************************ (./cs20-thinkcspy.listing) [241] ************************************************ Section 9.15 List Methods ************************************************ (./cs20-thinkcspy.listing) [242] Overfull \hbox (57.46002pt too wide) in paragraph at lines 14820--14836 [] Overfull \hbox (31.90002pt too wide) in paragraph at lines 14837--14837 [][]$[][][][][] [] [] [] [][][][] [] [][][][][][] [] [][][] [] [] [] [][][][][] [][] [] [][][][][][][][] [] [][][][] [] [][][][][][][][][][][][][][][][][][][][ ][][][][][][][][][][][][][][][]$[]| (./cs20-thinkcspy.listing) Overfull \hbox (3.004pt too wide) in paragraph at lines 14838--14844 \TU/lmr/m/n/10 strings, if an item does not exist in a list, the program will g enerate a \TU/Inconsolatazi4-Regular.otf(0)/m/n/10 ValueError\TU/lmr/m/n/10 . (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [243] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [244] ************************************************ Section 9.16 Interlude: The Scarcity Model ************************************************ [245] ************************************************ Section 9.17 Deleting Negative Elements: The Rewrite ************************************************ LaTeX Warning: Hyper reference `subsection-list_delete_describe_fix' on page 24 6 undefined on input line 15006. LaTeX Warning: Reference `subsection-list_delete_describe_fix' on page 246 unde fined on input line 15006. (./cs20-thinkcspy.listing) ************************************************ Subsection 9.17.1 Advanced Topic: When to Update a List ************************************************ (./cs20-thinkcspy.listing) [246] ************************************************ Section 9.18 Pure Functions ************************************************ LaTeX Warning: Hyper reference `section-lists_deletion-redux' on page 247 undef ined on input line 15068. LaTeX Warning: Reference `section-lists_deletion-redux' on page 247 undefined o n input line 15068. (./cs20-thinkcspy.listing) [247] ************************************************ Section 9.19 Which is Better? ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [248] ************************************************ Section 9.20 Advanced Topic: List Comprehensions ************************************************ LaTeX Warning: Hyper reference `section-lists_deletion-redux' on page 249 undef ined on input line 15156. LaTeX Warning: Reference `section-lists_deletion-redux' on page 249 undefined o n input line 15156. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Exercises 9.20 Exercises ************************************************ [249] (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `exercise-lists_pure_function_ex' on page 250 un defined on input line 15226. LaTeX Warning: Reference `exercise-lists_pure_function_ex' on page 250 undefine d on input line 15226. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [250] ************************************************ Section 9.21 Nested Lists ************************************************ (./cs20-thinkcspy.listing) [251] (./cs20-thinkcspy.listing) ************************************************ Subsection 9.21.1 Accessing Sublists and Sublist Elements ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [252] ************************************************ Subsection 9.21.2 Check Your Understanding ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [253] ************************************************ Subsection 9.21.3 Cloning Nested Lists ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Section 9.22 Working with Nested Lists ************************************************ ************************************************ Exercises 9.22 Exercises ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [254] [255] LaTeX Warning: Hyper reference `subsection-strings_f-strings' on page 256 undef ined on input line 15522. LaTeX Warning: Reference `subsection-strings_f-strings' on page 256 undefined o n input line 15522. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing Overfull \hbox (0.28288pt too wide) in paragraph at lines 38--39 [][][][][][][][][][][][][][][] Overfull \hbox (16.48305pt too wide) in paragraph at lines 39--40 [][][][][][][][][][][][][][] ) [256] ************************************************ Section 9.23 Strings and Lists ************************************************ (./cs20-thinkcspy.listing) [257] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [258] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [259] ************************************************ Section 9.24 Glossary ************************************************ ************************************************ Glossary 9.24 Glossary ************************************************ ************************************************ Exercises 9.25 Exercises ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [260] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [261] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [262] (./cs20-thinkcspy.listing) Overfull \hbox (15.41199pt too wide) in paragraph at lines 15906--15923 \TU/lmr/m/n/10 squares of the numbers in the list \TU/Inconsolatazi4-Regular.ot f(0)/m/n/10 num_list\TU/lmr/m/n/10 . For example, \TU/Inconsolatazi4-Regular.ot f(0)/m/n/10 sum_of_squares([2, (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [263] (./cs20-thinkcspy.listing) [264] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [265] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [266] ************************************************ Chapter 10 Files ************************************************ [267] Chapter 10. ************************************************ Section 10.1 Working with Data Files ************************************************ LaTeX Warning: Hyper reference `table-files_files_filemethods1a' on page 268 un defined on input line 16118. LaTeX Warning: Reference `table-files_files_filemethods1a' on page 268 undefine d on input line 16118. Overfull \hbox (300.45003pt too wide) in paragraph at lines 16119--16129 [] ************************************************ Section 10.2 Finding a File on your Disk ************************************************ [268] ************************************************ Section 10.3 Opening a File ************************************************ Overfull \hbox (33.66756pt too wide) in paragraph at lines 16168--16176 \TU/lmr/m/it/10 lute file path \TU/lmr/m/n/10 like \TU/Inconsolatazi4-Regular.o tf(0)/m/n/10 open(\TS1/Inconsolatazi4-Regular.otf(0)/m/n/10 '\TU/Inconsolatazi4 -Regular.otf(0)/m/n/10 /users/bmiller/my_files/all_projects/my_data/data3.txt\T S1/Inconsolatazi4-Regular.otf(0)/m/n/10 '\TU/Inconsolatazi4-Regular.otf(0)/m/n/ 10 , [269] ************************************************ Section 10.4 Iterating over lines in a file ************************************************ [270] (./cs20-thinkcspy.listing) [271] ************************************************ Section 10.5 Alternative File Reading Methods ************************************************ LaTeX Warning: Hyper reference `table-files_filemethods2a' on page 272 undefine d on input line 16286. LaTeX Warning: Reference `table-files_filemethods2a' on page 272 undefined on i nput line 16286. (./cs20-thinkcspy.listing) [272] Overfull \hbox (808.91006pt too wide) in paragraph at lines 16308--16319 [] (./cs20-thinkcspy.listing) ************************************************ Section 10.6 Writing Text Files ************************************************ LaTeX Warning: Hyper reference `section-files_working-with-data-files' on page 273 undefined on input line 16348. LaTeX Warning: Reference `section-files_working-with-data-files' on page 273 un defined on input line 16348. [273] LaTeX Warning: Hyper reference `section-files_alternative-file-reading-methods' on page 274 undefined on input line 16352. LaTeX Warning: Reference `section-files_alternative-file-reading-methods' on pa ge 274 undefined on input line 16352. (./cs20-thinkcspy.listing) [274] (./cs20-thinkcspy.listing) ************************************************ Section 10.7 Advanced Topic: \texttt {with} Statements ************************************************ (./cs20-thinkcspy.listing) [275] ************************************************ Section 10.8 Glossary ************************************************ ************************************************ Glossary 10.8 Glossary ************************************************ ************************************************ Exercises 10.9 Exercises ************************************************ (./cs20-thinkcspy.listing) [276] (./cs20-thinkcspy.listing) ************************************************ Chapter 11 Dictionaries ************************************************ [277] Chapter 11. ************************************************ Section 11.1 Dictionaries ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [278] LaTeX Warning: Hyper reference `figure-fig_dictionary_storage' on page 279 unde fined on input line 16587. LaTeX Warning: Reference `figure-fig_dictionary_storage' on page 279 undefined on input line 16587. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [279] (./cs20-thinkcspy.listing) ************************************************ Section 11.2 Dictionary Operations ************************************************ (./cs20-thinkcspy.listing) [280] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) LaTeX Warning: Hyper reference `section-simple-python-data_compound-assignment' on page 281 undefined on input line 16712. LaTeX Warning: Reference `section-simple-python-data_compound-assignment' on pa ge 281 undefined on input line 16712. (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [281] ************************************************ Section 11.3 Dictionary Methods ************************************************ Overfull \hbox (31.74pt too wide) in paragraph at lines 16763--16775 [] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [282] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) [283] (./cs20-thinkcspy.listing) [284] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [285] ************************************************ Section 11.4 Aliasing and Copying ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) [286] ************************************************ Section 11.5 Glossary ************************************************ ************************************************ Glossary 11.5 Glossary ************************************************ ************************************************ Exercises 11.6 Exercises ************************************************ (./cs20-thinkcspy.listing) [287] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing ) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [288] (./cs20-thinkcspy.listing) [289] (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [290] [291] ************************************************ Chapter 12 Exceptions ************************************************ [292] Chapter 12. ************************************************ Section 12.1 What is an Exception? ************************************************ (./cs20-thinkcspy.listing) ************************************************ Section 12.2 \texttt {try} and \texttt {except} ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) [293] ************************************************ Section 12.3 Multiple Exceptions ************************************************ (./cs20-thinkcspy.listing) (./cs20-thinkcspy.listing) ************************************************ Subsection 12.3.1 Advanced Topic: Unanticipated Exceptions ************************************************ LaTeX Warning: Hyper reference `section-exceptions_principles-for-using-excepti ons' on page 294 undefined on input line 17435. LaTeX Warning: Reference `section-exceptions_principles-for-using-exceptions' o n page 294 undefined on input line 17435. (./cs20-thinkcspy.listing) [294] ************************************************ Section 12.4 Principles for using Exceptions ************************************************ (./cs20-thinkcspy.listing) ! Interruption. \unvbox l.17476 \end{program} ?