Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
list_copy_shallow_deep.py
#python 3.5.2 #Deep copy thislist = ["apple", "banana", "cherry"] mylist = thislist.copy() print(mylist) thislist[0]=12 print(thislist) print(mylist) print(id(thislist) is id(mylist)) #Deep copy thislist = ["apple", "banana", "cherry"] mylist = list(thislist) print(mylist) thislist[0]=12 print(thislist) print(mylist) print(id(thislist) is id(mylist)) #shallow copy thislist = ["apple", "banana", "cherry"] mylist=thislist print(mylist) thislist[0]=12 print(thislist) print(mylist) print(id(thislist) is id(mylist))
run
|
edit
|
history
|
help
0
global 4
ElaineBrown** rextester.com
hahahah
check this converting week number (int) into week day name (string) [solved]
Lakshya chouhan
три шарика в матрице
0403_diamond
Place strings to proper bucket
Ej2_PYTHON_203700377.
short hand if else