Zachary Ware added the comment:
This is not a bug. The assignment "a = nums" doesn't create a copy of "nums",
it just assigns the name "a" to the same object that "nums" refers to. Since
lists are mutable, changes made to "a" are visible through the name "nums". By
the time you do "a[2] = nu
New submission from Sai Krishna G:
Hi, I am trying to rotate list of 3 to left
for this I am trying to define this function
def rotate_left3(nums)
#argument nums is list
for example
rotate_left3([1, 2, 3])
I am expecting value [2,3,1] in return. I have written the following code
a = nums