Skip to content Skip to sidebar Skip to footer

How To Use Any String From List As A Variable?

I would like to know how i could have a variable A to be any random string from ListA and B to be any random string from ListB? I would like to use this in a voice assistant and Vo

Solution 1:

I suggest reading what exists in the random module.

This is one of the things it offers:

list_a = ["search", "research"]
a = random.choice(list_a)

Post a Comment for "How To Use Any String From List As A Variable?"