Advertisement
Guest User

Untitled

a guest
Sep 18th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import re
  2.  
  3. if __name__ == '__main__':
  4. regex = re.compile(r'^([qwertyuiop]*|[asdfghjkl]*|[zxcvbnm]*)$')
  5. with open('words.txt', 'r') as fptr:
  6. for word in fptr:
  7. if regex.match(word):
  8. meat = regex.match(word).group(1)
  9. # Print words with length greater than 7:
  10. if len(meat) > 7:
  11. print('%s (%d)' % (meat, len(meat)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement