Assignment 2
Using Functions and Files for Automatic Web Page Production
Submit before 11:30 PM Saturday September 25
Overview
You will use Python functions to generate a customized web page.
Requirements
Complete the following Parsons problems. A correct solution will
appear in green after you click on the 'Get feedback' link.
- Race comparison (multi-part
if statement)
- A is for Ant Scramble (loop
with list)
Starting with the function presented in class, create a Python
program that queries the user and generates a formatted web page.
The program should have at least the following properties:
- At least one new (fruitful) function that you created that
generates html content. This function should take parameters
that specify content (e.g. a name, place or list of chores) and
then return a string of HTML-formatted content. You should be
able to test this function in the console (called a unit test).
- A query to the user asking for content that includes a string
(e.g. a name), a number and a
list. The supplied content must appear on the page.
- A query on style properties such as color. The page must be
displayed with those properties.
- A content element that is chosen at random.
Deliverables
Submit two attachments:
- A txt file (e.g. README.txt) that includes the following:
- A summary of your
accomplishments (include collaboration and process notes)
- A demo showing the user interaction
- A unit test that shows that your fruitful function works
- Your source code (i.e. your Python program)
- A screen shot showing how your page appears in a browser.
The assignment is worth 10 points. In addition to meeting the
requirements, full credit requires a neatly formatted txt file with
well written content.
Useful HTML References
In addition to your text, here are some useful references for
creating pages: