Question: Write a function that opens a simple HTML file and makes sure every opened HTML tag (that requires a closer -- tags like are ignored)

Write a function that opens a simple HTML file and makes sure every opened HTML tag (that requires a closer -- tags like are ignored) is closed in the reverse order they were opened. Function returns True for correctly-formatted files; False otherwise.

  1. Hint: type your simple (e.g. about 10 lines long) HTML file in a separate file and use the fil = open(...) command you might remember from CS1 in your program to open it and then read in each line as a string

  2. You need only use simple single-word tags in your example files that have closing-tags (e.g.

    etc. vs: or )

  3. Also, make sure you test some HTML files that return FALSE (i.e. imperfectly-formatted HTML)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!