I currently need to create an array of size x and fill it with either 1s or -1s randomly divided. I can easily create an array and fill it with randint but the problem with that would be that I do not want 0s in my array.
I also have a precise number of the length of the array so I need to make sure that I have in total 100 or 1000 ints in it.
If anyone knows how to solve this smoothly it would be very much appreciated.
Thanks
Aucun commentaire:
Enregistrer un commentaire