Haven’t posted in a couple weeks, but I’ve been plugging away with Python. (Maybe `struggling away’ more accurate.)
Anyway, I have code to generate a list of random integers.
Ctr = 0 AlDif = False # Not using `All Different' yet. NumLst =  while Ctr < 5: NumLst.append (random.randint (1, 9)) Ctr += 1 print (NumLst)
Output something like [4, 6, 8, 6, 4]
I want to replace the with a different, unique random integer. In the above list, I’d like to replace the second six and the second four.
Now, I can do that by brute force:
If (NumLst  == NumLst  or NumLst  = NumLst  …) and so on.
I did exactly that with a list that had only four items and it worked fine. But obviously inefficient. Any suggestions how I might be able to change the duplicates efficiently??