mercredi 27 septembre 2023

Generating an array of random numbers with conditions

I have a list of length 64, such as first_list = [64, 27, 99, 133, 0, 41, ... ]. Numbers in this are some random selection from 0 to 150 (minimum value is 0 and maximum value is 149).

I want to generate several other list of random number with the same minimum and maximum condition (between 0 to 150), and also in the new list (let's call it new_list), new_list[0] != first_list[0], new_list[1] != first_list[1], new_list[2] != first_list[2] , ...

Is there any fast way of implementing this?




Aucun commentaire:

Enregistrer un commentaire