you should import your Module or external library first.
and random module dose not have random.str() function!
Try This :
import random
a = ['blue', 'red', 'green', 'yellow', 'brown', 'black']
print(random.choice(a))
Good Luck.
1
solved How to generate a random word