Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- hdata = [
- ['D', 'I', 'R', 'A', 'R', 'T', 'I', 'C', 'L', 'E'],
- ['H', 'B', 'N', 'O', 'F', 'R', 'A', 'M', 'E', 'S'],
- ['F', 'I', 'G', 'U', 'R', 'E', 'O', 'N', 'A', 'V'],
- ['S', 'G', 'H', 'E', 'A', 'D', 'E', 'R', 'U', 'A'],
- ['E', 'S', 'C', 'O', 'M', 'M', 'A', 'N', 'D', 'P'],
- ['C', 'E', 'N', 'T', 'E', 'R', 'L', 'Y', 'I', 'P'],
- ['T', 'W', 'Y', 'A', 'S', 'I', 'D', 'E', 'O', 'L'],
- ['I', 'T', 'I', 'M', 'E', 'F', 'O', 'N', 'T', 'E'],
- ['O', 'R', 'D', 'A', 'T', 'A', 'L', 'I', 'S', 'T'],
- ['N', 'E', 'G', 'A', 'C', 'R', 'O', 'N', 'Y', 'M']
- ]
- # Make reverse list of lists
- vdata = list()
- for i in xrange(len(hdata[0])):
- mini = list()
- for j in xrange(len(hdata)):
- mini.append(hdata[j][i])
- vdata.append(mini)
- newtags = ['article', 'aside', 'audio', 'bdo', 'canvas',
- 'command', 'datalist', 'details', 'embed',
- 'figcaption', 'figure', 'footer', 'header',
- 'hgroup', 'keygen', 'mark', 'meter', 'nav',
- 'output', 'progress', 'rp', 'rt', 'ruby',
- 'section', 'source', 'summary', 'time', 'video', 'wbr']
- deprecatedtags = ['acronym', 'applet', 'basefont', 'big',
- 'center', 'dir', 'font', 'frame',
- 'frameset', 'isindex', 'noframes', 'strike', 'tt']
- newfound = list()
- deprecatedfound = list()
- ## Find
- for i in xrange(len(hdata)):
- for j in newtags:
- if j in reduce(lambda x, y: ''.join([x, y]), hdata[i]).lower():
- newfound.append(j)
- for k in deprecatedtags:
- if k in reduce(lambda x, y: ''.join([x, y]), hdata[i]).lower():
- deprecatedfound.append(k)
- for i in xrange(len(vdata)):
- for j in newtags:
- if j in reduce(lambda x, y: ''.join([x, y]), vdata[i]).lower():
- newfound.append(j)
- for k in deprecatedtags:
- if k in reduce(lambda x, y: ''.join([x, y]), vdata[i]).lower():
- deprecatedfound.append(k)
- ## Delete duo and sort
- newfound = sorted(set(newfound))
- deprecatedfound = sorted(set(deprecatedfound))
- ## Print result
- print 'Find', len(newfound), 'from NEW tags', newfound
- print 'Find', len(deprecatedfound), 'from DEPRECATED tags', deprecatedfound
Advertisement
Add Comment
Please, Sign In to add comment