Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import random
- words = open('/usr/share/dict/words', 'r')
- words = words.readlines()
- ism = '(en|in).+'
- lin_words = []
- for word in words:
- if re.match(ism, word):
- word = 'lin' + word[2:]
- lin_words.append(word)
- rand_int = random.randint(0, len(lin_words))
- print lin_words[rand_int]
Add Comment
Please, Sign In to add comment