ASAP Need Python Code for the following function with comments and screenshot of the code:
1. Matching tags in a Markup Language One of the applications of Stack is in the validation of markup languages such as HTML, HTML is the standard format for hyperlinked documents on the Internet. We show a sample HTML document and a possible rendering in figure below: The Little Boat
The Little Boat
The storm tossed the little boat like a cheap sneaker in an old washing machine. The three drunken fishermen were used to such treatment, of course, but not the tree salesman, who even as a stowaway now felt that he had overpaid for the voyage.
- Will the salesman die?
- What color is the boat?
- And what about Naomi?
(a) The storm tossed the little boat like cheap sneaker in an old washing machine. The three drunken fishermen were used to such treatment, of course, but not the tree salesman, who even as a stowaway now felt that he had overpaid for the voyage. 1. Will the salesman die? 2. What color is the boat? 3. And what about Naomi? (b) In a HTML document, portions of text are delimited by HTML tags. A simple opening HTML tag has the form "
" and the corresponding closing tag has the form "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: In a HTML document, portions of text are delimited by HTML tags. A simple opening HTML tag has the form "" and the corresponding closing tag has the form "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: body: document body . .h1: section header center center justify p: paragraph ol: numbered (ordered) list li: list item Write a function isHtmlMatched (rawhtml) that takes raw html text and checks if the text has matching tags using Stack Note: 1. You are allowed to use a single Stack for this question 2. You can only use Stack functions (push, pop, top, is_empty) on Stack. 3. You can assume that the HTML input contains only commonly used tags given above (body, h1, center, p, ol, li). 1. Matching tags in a Markup Language One of the applications of Stack is in the validation of markup languages such as HTML, HTML is the standard format for hyperlinked documents on the Internet. We show a sample HTML document and a possible rendering in figure below: The Little Boat The Little Boat
The storm tossed the little boat like a cheap sneaker in an old washing machine. The three drunken fishermen were used to such treatment, of course, but not the tree salesman, who even as a stowaway now felt that he had overpaid for the voyage.
- Will the salesman die?
- What color is the boat?
- And what about Naomi?
(a) The storm tossed the little boat like cheap sneaker in an old washing machine. The three drunken fishermen were used to such treatment, of course, but not the tree salesman, who even as a stowaway now felt that he had overpaid for the voyage. 1. Will the salesman die? 2. What color is the boat? 3. And what about Naomi? (b) In a HTML document, portions of text are delimited by HTML tags. A simple opening HTML tag has the form "" and the corresponding closing tag has the form "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: In a HTML document, portions of text are delimited by HTML tags. A simple opening HTML tag has the form "" and the corresponding closing tag has the form "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: body: document body . .h1: section header center center justify p: paragraph ol: numbered (ordered) list li: list item Write a function isHtmlMatched (rawhtml) that takes raw html text and checks if the text has matching tags using Stack Note: 1. You are allowed to use a single Stack for this question 2. You can only use Stack functions (push, pop, top, is_empty) on Stack. 3. You can assume that the HTML input contains only commonly used tags given above (body, h1, center, p, ol, li)