Source Code:
(back to article)
import random my_list = [1, 2, 3, 4, 5] random_subset = random.sample(my_list, 3) print(random_subset)
Result:
Report an issue