This question already has an answer here:
- Get a random sample with replacement 4 answers
Please show me a solution that EXACLY answeres my question. If you show me a stackoverflow answered question that is 100% the solution of my question --> I will delete my question
need to create list with random int values like [1,2,3,4,3,2,5,6,7,4,..]
. Duplicates are allowed!!!! All solution I found are
- creating lists with uniques
- using list comprehention..
There should be something like : list_randoms = random.sample(range(1, 10), 9)
--> this creates list of uniqes.
Also listcomprehention/numpy/etc should not be the solution.
There should be a python build-in function for that which I cannot find now.
Not answered as I expect:
How do I generate a random list in Python with duplicates numbers
Generate Random List of Random Numbers with Duplicates in Python 3.4
Python: Random numbers into a list
Aucun commentaire:
Enregistrer un commentaire