fork download
  1. from random import randint
  2.  
  3. a = [1, 2, 3, 4, 1, 3]
  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 0.01s 33864KB
stdin
Standard input is empty
stdout
[1, 2, 3, 4, 8, 9]