7
I have the following situation:
I have a vector with 4 indexes. In each index a random value is generated from 0 to 100.
I have a code that does this perfectly, but sometimes the numbers repeat.
Below the code:
from random import randint
AP_X = [randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100)]
print AP_X
I wish that NEVER repeated numbers are generated. For example: [4,4,6,7]
How can I do that?
Thank you! It worked correctly.
– Danilo