1926c960eSShuo Chen#!/usr/bin/python 2926c960eSShuo Chen 3926c960eSShuo Chenimport random 4926c960eSShuo Chen 5926c960eSShuo Chenword_len = 5 6926c960eSShuo Chenalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' 7926c960eSShuo Chen 8926c960eSShuo Chenoutput = open('word_count', 'w') 9926c960eSShuo Chenwords = set() 10926c960eSShuo ChenN = 1000*1000 11926c960eSShuo Chenfor x in xrange(N): 12926c960eSShuo Chen arr = [random.choice(alphabet) for i in range(word_len)] 13926c960eSShuo Chen words.add(''.join(arr)) 14926c960eSShuo Chen 15926c960eSShuo Chenprint len(words) 16926c960eSShuo Chenfor word in words: 17926c960eSShuo Chen output.write(word) 18926c960eSShuo Chen output.write('\t') 19926c960eSShuo Chen output.write(str(random.randint(1, 2*N))) 20926c960eSShuo Chen output.write('\n') 21926c960eSShuo Chen 22