fork download
  1. from random import randint
  2.  
  3. a = [1, 2, 3, 4, 1, 1, 1, 1, 1]
  4. b = []
  5.  
  6. for value in a:
  7. while value in b:
  8. value = randint(1, 11)
  9. b.append(value)
  10.  
  11. print b
Success #stdin #stdout 0s 33816KB
stdin
Standard input is empty
stdout
[1, 2, 3, 4, 7, 11, 8, 6, 10]