(Apr-12-2020, 03:09 PM)donmerch Wrote: It just stood out to me why one type of object (integer, list) is referred to differently inside and outside a function.First of all,
int
and list
are different types. There is difference because lists are mutable. Same will apply to other mutable objects like dict.However, when it comes to assignment, it's not different (your first snippet). You must make distinction when you assign to name
c
and when you change element INSIDE mutable object (i.e. c[0]
)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs