Checkpoint 5.1.11. A Python program, including another.
Compute the total amount of money loaned and store it in the variable
loan_total
.@language
is not specified, docinfo/programs/@language
will be checked to determine what language to assume the code is written in.<program>
is not interactive, by default, no matter where it is hosted.<listing>
since we will want to reference it shortly. The program does not do very much, it just defines four variables whose values are lists of statistics. It should run, and there will be no syntax errors, but it is a bit boring since there is no output.<program>
lacks a @language
attribute. It is relying on the docinfo/programs/@language
value that is in bookinfo.xml. If present, that attribute will be used for any programs or Runestone interactives that lack a @language
.<program>
recycled from before.@include
attribute on the including program whose value is the @xml:id
of the included program. So by running the next program, it should pass all of its three tests (for example another example using unit tests, see Checkpoint 5.3.4). Now reload the page, do not run the program in the listing, and then see that the program in the exercise still runs correctly.loan_total
.print()
statement.loan_total
.@language
set to sql
uses the @database
to load a SQLite database file.test
database table.