fork(1) download
  1. A = [2, 3, 4, 5]
  2.  
  3. B = [[i for i in A] for n in range(5)]
  4.  
  5. #and prove that they are unique
  6. print ('reference sharing? {}'.format (B [0] is B [1]))
  7.  
  8. print (B)
Success #stdin #stdout 0.01s 28384KB
stdin
Standard input is empty
stdout
reference sharing? False
[[2, 3, 4, 5], [2, 3, 4, 5], [2, 3, 4, 5], [2, 3, 4, 5], [2, 3, 4, 5]]