I am currently working in Python 3. I would like to make some modifications to a list. So, I copied the original list(nums)
to another list(nums1)
. When I am popping out any element from list nums1 then I am also loosing that element from nums. How do I make sure I am poppin an element only from one list.
nums = [1,2,3]
nums1 = nums
nums1.pop(1)
print(nums)
print(nums1)
output
[1, 3]
[1, 3]