Unsure with how I could code this

I am making a project where there are two robots but they are permanently in a loop of replying to each other with random words. The thing is that I want to make a list of words for the robots to say, but I’m unsure how to make a code that randomly selects the words and put it in a message.

(Also can you make two or more separate lists? I want to make lists separately for the beginning, middle, and end of a sentence.)

untitled script pic (10)

Untitled script pic
Would something like this work?