choice random word in python from a text file
import random
print(random.choice(open('file.txt').read().split()).strip())
choice random word in python from a text file
import random
print(random.choice(open('file.txt').read().split()).strip())
how to get random word from text file in python
import random
def importword(): # finding a random word in the dictionary
file = open("wdd.txt", "r")
for x in range(0,random.randint(0,466909)):
word = file.readline(x)
return word
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us