The problem is that I have a list "l"
of which I want to select a random item several times without repeating it, and I do not know how to do it. Any suggestions?
import random
l = ["a", "b", "c", "d"]
sel1 = random.choice(l)
That's fine, but now I want to define a "sel2"
that is a random element of "l"
but different of "sel1"
. And so we can continue defining a "sel3"
different from "sel1"
and "sel2"
.
Thanks in advance =)