Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
choice random word in python from a text file
Tomek Buszewski
Programming language:
Python
2021-07-26 16:27:39
-1
Q:
choice random word in python from a text file
user51339
Code:
Python
2021-07-29 05:29:35
import random print(random.choice(open('file.txt').read().split()).strip())
0
Tags
python
file
text
random
word
text file
Related
how to make a python file that prints out a random element from a list
python choose random sample from list
python get random character from string
select random img in python using os.listdir
select random value from list python
choose a random snippet of text
how to get random number python
getting vocab from a text file python
how to get python to extract information from a text file
python choose random element from list
python random generator from list
generate random word python
print random string from list python
select a random element from a list python
python random choice from list
pick a random number from a list in python
random picker in python
New to Communities?
Join the community