Is there a library containing an array of many words for use in python?

Viewed 33

I need to generate random words and thought to do this using an array, for example

import random

wordArray = ["wordOne", "wordTwo"...]

word = wordArray[random.randint(0, len(wordArray))]

Is there anywhere containing a large python array of words or do I have to do this manually?

2 Answers

there is a library name random_word you can create a loop over and save random word in list also.

from random_word import RandomWords

r = RandomWords()

# Return a single random word
r.get_random_word()
# Return list of Random words
r.get_random_words()
# Return Word of the day
r.word_of_the_day()

source

Related