Author Yaowei Zhang
Recipients Yaowei Zhang
Date 2017-02-17.02:03:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487297025.75.0.614273224132.issue29584@psf.upfronthosting.co.za>
In-reply-to
Content
#If we define a list by:
nums = [[0]*3]*3
#nums = [[0,0,0],[0,0,0],[0,0,0]]
nums[0][1] = 1
print(mums)
# the result is
[[0,1,0],[0,1,0],[0,1,0]]
#I think it is because all the line use the same list variable, but it suppose #not.
History
Date User Action Args
2017-02-17 02:03:45Yaowei Zhangsetrecipients: + Yaowei Zhang
2017-02-17 02:03:45Yaowei Zhangsetmessageid: <1487297025.75.0.614273224132.issue29584@psf.upfronthosting.co.za>
2017-02-17 02:03:45Yaowei Zhanglinkissue29584 messages
2017-02-17 02:03:45Yaowei Zhangcreate