Created
September 18, 2015 17:21
-
-
Save shivamMg/1c4e2a53993a1bb07559 to your computer and use it in GitHub Desktop.
BLOG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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