You are viewing a single comment's thread. Return to all comments →
My version :
from html.parser import HTMLParser import sys html_chunk = ''.join(sys.stdin.readlines()[1:]) class Parser(HTMLParser): def handle_starttag(self, tag: str, attr: list)-> None: print(tag) if not len(attr)==0: for k, v in attr: print(f'-> {k} > {v}') parser = Parser() parser.feed(html_chunk)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Detect HTML Tags, Attributes and Attribute Values
You are viewing a single comment's thread. Return to all comments →
My version :