fork download
  1. from random import randint
  2.  
  3. a = [1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  4. b = []
  5.  
  6. if len(a) <= 11:
  7. for value in a:
  8. while value in b:
  9. value = randint(1, 11)
  10. b.append(value)
  11.  
  12. print b
  13. else:
  14. print "A lista 'a' deve conter no máximo 11 elementos."
Success #stdin #stdout 0.01s 32928KB
stdin
Standard input is empty
stdout
A lista 'a' deve conter no máximo 11 elementos.