Guest User

Untitled

a guest
Apr 2nd, 2021
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. import random
  2.  
  3. def get_random_word(path='words.txt'):
  4.     with open(path) as f:
  5.         words = f.read().split('\n')
  6.         random.shuffle(words)
  7.         return words[0]
Advertisement
Add Comment
Please, Sign In to add comment