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#only thislist gets affected print(thislist) print(mylist) print(id(thislist) is id(mylist))#False #Deep copy thislist = ["apple", "banana", "cherry"] mylist = list(thislist) print(mylist) thislist[0]=12#only thislist gets affected print(thislist) print(mylist) print(id(thislist) is id(mylist))#False #shallow copy thislist = ["apple", "banana", "cherry"] mylist=thislist print(mylist) thislist[0]=12#both lists get affected print(thislist) print(mylist) print(id(thislist) is id(mylist))#False
run
|
edit
|
history
|
help
0
Simulare
python, attributes, setter and getter the pythonic way (V2)
GINGERMANZ
Calculate Volume of Sphere
Emails_Python
Simple calculator
Юра и заселение
あだだだだだだだだだだだだだだだだだだだだだだだだ
Lab_I_2_25_11_2020
perform_math.py