You are viewing a single comment's thread. Return to all comments →
import re T = int(input())
pattern = r'\<([A-Za-z0-9]{1,})|\<\s+([A-Za-z0-9]{1,})' tag_set = set()
while T>0: line = input() pattern_found = re.findall(pattern, line) for p in pattern_found: tag_set.add(p[0]) tag_set.add(p[1]) T-=1
print(";".join(sorted([tag for tag in tag_set if len(tag) > 0 ])))
Seems like cookies are disabled on this browser, please enable them to open this website
Detect HTML Tags
You are viewing a single comment's thread. Return to all comments →
import re T = int(input())
pattern = r'\<([A-Za-z0-9]{1,})|\<\s+([A-Za-z0-9]{1,})' tag_set = set()
while T>0: line = input() pattern_found = re.findall(pattern, line) for p in pattern_found: tag_set.add(p[0]) tag_set.add(p[1]) T-=1
print(";".join(sorted([tag for tag in tag_set if len(tag) > 0 ])))