Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement