Skip to content

Instantly share code, notes, and snippets.

@shivamMg
Created September 18, 2015 17:21
Show Gist options
  • Save shivamMg/1c4e2a53993a1bb07559 to your computer and use it in GitHub Desktop.
Save shivamMg/1c4e2a53993a1bb07559 to your computer and use it in GitHub Desktop.
BLOG
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)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment