python list

python list are passed by reference

a=b=[1,2,3]

id(a)==id(b) returns true

i.e they have same memory address

modifying a also modifies b.

to make copy list use copy() or 

new=old[:]

Comments

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

fix idm integration on chrome

Hidden Wiki