Adapting the code from Lab 12 and adding to this code
(documents.py), create a
function textPage that returns a string
representation of a page listing each sample of the documents
with their corresponding titles with the main title at the
top. This should be done programatically just like during Lab
12.
- Input: none
- Output: string
E.g.
Great Documents of the United States
Declaration of Independence
We hold these truths to be self-evident, that all men are created
equal, that they are endowed by their Creator with certain unalienable
Rights, that among these are Life, Liberty and the pursuit of
Happiness.
Preamble to the Constitution
We the People of the United States, in Order to form a more perfect
Union, establish Justice, insure domestic Tranquility, provide for the
common defence, promote the general Welfare, and secure the Blessings
of Liberty to ourselves and our Posterity, do ordain and establish
this Constitution for the United States of America.
Gettysburg Address
Four score and seven years ago our fathers brought forth on this
continent a new nation, conceived in Liberty, and dedicated to the
proposition that all men are created equal.
Similar to textPage, create a function
webPage that returns a string representation
of a page listing each sample of the documents with their
corresponding titles with the main title at the top. However,
this string representation should be formatted as HTML.
- Input: none
- Output: string
E.g.
<html>
<body>
<h1>Great Documents of the United States</h1>
<h2>Declaration of Independence</h2>
<p>
We hold these truths to be self-evident, that all men are created
equal, that they are endowed by their Creator with certain unalienable
Rights, that among these are Life, Liberty and the pursuit of
Happiness.
</p>
<h2>Preamble to the Constitution</h2>
<p>
We the People of the United States, in Order to form a more perfect
Union, establish Justice, insure domestic Tranquility, provide for the
common defence, promote the general Welfare, and secure the Blessings
of Liberty to ourselves and our Posterity, do ordain and establish
this Constitution for the United States of America.
</p>
<h2>Gettysburg Address</h2>
<p>
Four score and seven years ago our fathers brought forth on this
continent a new nation, conceived in Liberty, and dedicated to the
proposition that all men are created equal.
</p>
</body>
</html>