vendredi 8 janvier 2016

Randomly selecting elements from a set in Python

If I have a set like so:

s = set(range(1,100))

How might I randomly generate a subset of s containing k distinct elements?




Aucun commentaire:

Enregistrer un commentaire