import random
value = 1000
a = []
i = 0
b = [None] * 16
print('value = ',1000)
for x in range(value):
a.append(x)
random.Random(4).shuffle(a)
print(a)
for x in range(16):
b[x] = a[x]
print(b)
This code generate 16 random numbers selected up to the range 1000.But how to generate numbers that has different modulus values from 1 to 26 like this in python ?
Consider the numerical example
the values obtained randomly are:
184,15,106,8,93,150,210,144,271,365,65,60,385,164,349,405
when we perform a mod 26
operation with all these numbers we get
0,15,2,8,15,20,2,14,11,1,13,8,21,8,11,15
respectively
here the numbers 15,8,11,2
are repeating. so i want to eliminate this repeatation. for that i want to generate random numbers that have distinct values while performing a mod 26
operation.