I want to generate n unique elements from a list of numbers. I came across this answer but that only gives me one element. I want n distinct elements from the list.
How do I go about doing this?
I have tried using rand(list,n)
but this sometimes gives me repeated elements from list
so that doesn't work.
Aucun commentaire:
Enregistrer un commentaire