choice random word in python from a text file

96

choice random word in python from a text file -

import random
print(random.choice(open('file.txt').read().split()).strip())

Comments

Submit
0 Comments