I want to generate 6 random numbers (random numbers from 1 to 49). There is a list of pre-generated numbers and Python should generate random numbers which are different than the numbers of the list. At least three of the randomly generated numbers should be unique.
Example:
These 6 numbers are randomly generated:
1, 2, 3, 4, 5, 6
There is a list of pre-generated numbers:
2,3,4,5,6 (NOT added to list of new generated combinations)
4,5,6,7,8 (NOT added to list of new generated combinations)
5,6,7,8,9 (added to list of new generated combinations)
30,14,29,2,10,7 (added to list of new generated combinations)
Python checks that at least 3 numbers of the new list are unique. If yes then it adds the generated numbers to an array.
Aucun commentaire:
Enregistrer un commentaire