This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sai.Krishna.G
Recipients Sai.Krishna.G
Date 2014-08-02.20:35:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407011733.93.0.772896051293.issue22124@psf.upfronthosting.co.za>
In-reply-to
Content
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
    a[0]=nums[1]
    a[1]=nums[2]
    a[2]=nums[0]
    return a #this is returning [2,3,2] instead of [2,3,1]
however if I assign
a = [0,0,0] #or any other value other than directly assigning nums
the code works perfectly
History
Date User Action Args
2014-08-02 20:35:34Sai.Krishna.Gsetrecipients: + Sai.Krishna.G
2014-08-02 20:35:33Sai.Krishna.Gsetmessageid: <1407011733.93.0.772896051293.issue22124@psf.upfronthosting.co.za>
2014-08-02 20:35:33Sai.Krishna.Glinkissue22124 messages
2014-08-02 20:35:33Sai.Krishna.Gcreate