e = [ [1,2,[3,4,[5,6],7],8,9], 10] def deep_copy(mylst): # End of the list if mylst == []: return [] # I have reached an integer/string elif type(mylst) != list: return [mylst] # This is a list, and the index 0 element is a list, # so I will need to go down a layer elif type(mylst[0]) == list: return [deep_copy(mylst[0])] + deep_copy(mylst[1:]) else: # [0] will return the [mylst], and [1:] continues return deep_copy(mylst[0]) + deep_copy(mylst[1:]) b = deep_copy(e) e[0][2][2][0] = 100 print(e) # >>> [[1, 2, [3, 4, [100, 6], 7], 8, 9], 10] print(b) # >>> [[1, 2, [3, 4, [5, 6], 7], 8, 9], 10] e = [ [1,2,[3,4,[5,6],7],8,9], 10] b = e.copy() e[0][2][2][0] = 100 print(e) # >>> [[1, 2, [3, 4, [100, 6], 7], 8, 9], 10] print(b) # >>> [[1, 2, [3, 4, [100, 6], 7], 8, 9], 10]