Skip to content

Commit

Permalink
Update 30_copy_deepcopy.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MorvanZhou authored Jun 14, 2016
1 parent 09f35b7 commit d1869a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion basic/30_copy_deepcopy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# View more python learning tutorial on my Youtube and Youku channel!!!

# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial

import copy

a = [1,2,3]
Expand All @@ -18,4 +23,4 @@
a = [1,2,[3,4]]
d = copy.copy(a)
print(id(a) == id(d))
print(id(a[2]) == id(d[2]))
print(id(a[2]) == id(d[2]))

0 comments on commit d1869a1

Please sign in to comment.