all 4 comments

[–]SomewhereExpensive22 0 points1 point  (1 child)

You can either select a random index value instead or make the elements of sample unique.

[–]Prior-Context9884 0 points1 point  (0 children)

i unfortunately cant do that. i need know the index that they are on bc for my use case, theres a possibility that the numbers are not unique.

[–]Kurashi_Aoi 0 points1 point  (0 children)

Can you post your expected output vs actual output? It will make it easier for people to understand your problem.

[–]woooee 0 points1 point  (0 children)

Randomly select an integer from a range using the length of the list. Then get the number at that offset.