random.sample() function - Python
sample() is an built-in function of random module in Python that returns a particular length list of items chosen from the sequence i.e. list, tuple, string or set. Used for random sampling without replacement. Example: [GFGTABS] Python from random import sample a = [1, 2, 3, 4, 5] print(sample(a,3)