Friday 18 September 2015

Typewriter

Words that can be typed by using exactly one set of keys, i.e.
Either
Q W E R T Y U I O P
or
A S D F G H J K L
or
Z X C V B N M

import re

if __name__ == '__main__':
    regex = re.compile(r'^([qwertyuiop]*|[asdfghjkl]*|[zxcvbnm]*)$')
    with open('words.txt', 'r') as fptr:
        for word in fptr:
            if regex.match(word):
                meat = regex.match(word).group(1)
                # Print words with length greater than 7:
                if len(meat) > 7:
                    print('%s (%d)' % (meat, len(meat)))
etiquette (9)
perpetuity (10)
pirouette (9)
potpourri (9)
preterite (9)
prettier (8)
priority (8)
property (8)
proprietor (10)
propriety (9)
prototype (9)
puppeteer (9)
puppetry (8)
repertoire (10)
repertory (9)
reporter (8)
territory (9)
torturer (8)
tripwire (8)
typewriter (10)

Typewriter is one of the largest in the result set, but not the only one.


2 comments:

  1. Casino Bonus Codes - December 2021
    No deposit bonus casino promotions. We recommend 2021 casino bonus codes https://octcasino.com/ and promos poormansguidetocasinogambling.com for new players. 메이피로출장마사지 We also list new https://deccasino.com/review/merit-casino/ casino bonuses for December kadangpintar 2021.

    ReplyDelete

Comment!

Note: only a member of this blog may post a comment.