Question: This problem is to write a Python program which will generate an HTML document. Create an .html file for output. (I called mine MyPage.html) Prompt
This problem is to write a Python program which will generate an HTML document.
Create an .html file for output. (I called mine MyPage.html)
Prompt the user for:
A background color
A Page heading
Some text
A heading for a List
Some list items (This should be a while loop allowing the user to enter as many items as needed. Use a Sentinel value (choose a value) that triggers completion of entry
Your program needs to generate the appropriate HTML code. The HTML must also include a Title of your choosing.
Your program does not need to open the HTML document. You will view your HTML by opening it in a browser after your program is done generating it. Remember to use TextEdit or Notepad to view the HTML as text while you write your program to make sure it's generating the HTML correctly.
Hint: Before you begin the Python program, you may want to write for a static page and start from there.
Don't forget to use the HTML validator (https://validator.w3.org) to validate your HTML. Warnings are ok.
Grading breakdown:
You must turn in a Python program as a .py file to receive credit.
1 point for appropriate use of comments, including your name
2 points for example output:
- 1 point for the Python Window
- 1 point for the HTML file
3 points for prompting for one-time information:
1 point each for page heading, text, and list heading
5 points for the while loop which asks the user for list items.
- 2 points for the correct boolean expression causing the loop to continue or exit at the right time
- 1 point for prompting the user for the next list item
- 1 point for using a while loop
- 1 point for reminding the user what the sentinel value is
4 points for proper HTML generation of page title, page heading, text, and list heading
2 points for proper HTML generation of the list
1 point for correctly opening and writing to the .html file
1 point for remembering to close your file
1 point for proper HTML (Remember to check this using https://validator.w3.org)
You should not have any "break" or "continue" statements in your code. Doing so will reduce your score by 1 point for each one.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
