samedi 7 août 2021

How to choose k numbers less than n without repeats? [duplicate]

I try to look for an answer here and I didn't found...

There is a way at Python to do this:
k numbers less then n with no returns?

for example:

I want 20 random numbers that are less than 100, and they will be unique (i.e. no repeats).
I try to look at the Random class but I don't find option like this.

Can you tell me please if there is an option for this?




Aucun commentaire:

Enregistrer un commentaire