Pick a random choice from a list in Python without repeating

I have a list lets say x = [8,6,4,1] I want to pick a random element from this list in Python but each time picking this item shouldn't be the same item picked previously. So I don't want a repetition

How can I do this ?



Read more here: https://stackoverflow.com/questions/67380968/pick-a-random-choice-from-a-list-in-python-without-repeating

Content Attribution

This content was originally published by Omar at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: