Let's assume I have 5 variables, A
to E
.
I've stuck them in a list, like so:
lst = [A, B, C, D, E]
Using the python random module, I did this:
random.choice(list) = "The Chosen Letter"
However, as I'm sure you know, I was so rudely slapped with a "can't assign to function call" error. That's not what I'm asking about, I know why that happens.
What I want to know is if it is, indeed, possible to assign a value to a random variable from a list or if I will have to code an ugly workaround.
For context, it's for a dynamic grid that I'm trying to code with randomly spawning text.