Open this example in the interactive library
Source code
from random import Random
print(Random(7).sample(['a', 'b', 'c', 'd'], k=2))Sample output
['c', 'a']

Open this example in the interactive library
from random import Random
print(Random(7).sample(['a', 'b', 'c', 'd'], k=2))['c', 'a']