I added an optional parameter called part_of_speech to all three functions in random_word.py so that the user could specify a part of speech for the random word if necessary. The default value of part_of_speech is None but can be set in the following way:
'noun' # Setting part_of_speech to noun will only return nouns
'verb' # Setting part_of_speech to verb will only return verbs
'adjective' # Setting part_of_speech to adjective will only return adjectives
I added an optional parameter called
part_of_speech
to all three functions in random_word.py so that the user could specify a part of speech for the random word if necessary. The default value ofpart_of_speech
isNone
but can be set in the following way: