fork download
  1. A = [2, 3, 4, 5]
  2. B = [A[:] for n in range(5)]
  3. #and prove that they are unique
  4. print ('reference sharing? {}'.format (B [0] is B [1]))
  5. print (B)
  6.  
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]]