Feb-06-2019, 05:55 AM
Ok so numbers, strings, and tuples are immutables, but lists are mutable.
There was this example in link:
nums = [1, 2, 3]
other = nums
nums.append(4)
print(other) ## 1, 2, 3, 4
is there any way where I can transfer only values of nums to other. like only values of one list of numbers to the values of second list of numbers without linkining them. cause I'll be using the main list repeatedly?
There was this example in link:
nums = [1, 2, 3]
other = nums
nums.append(4)
print(other) ## 1, 2, 3, 4
is there any way where I can transfer only values of nums to other. like only values of one list of numbers to the values of second list of numbers without linkining them. cause I'll be using the main list repeatedly?