Videos
I learned that int, string, float, boolean are primitive and array, list, tuple, dict, set, file are non primitive..
Now i'm particularity interested in the actual differences between the two...
I know from learning java that in primitive type, it copy the actual value and therefore changing one value won't change a different variable even if they were used the same root var..
Non primitive however, only use references and therefore changing one value will change in all the vars that store the same reference...
What else am i missing regarding primitive vs non primitive data types?
Thanks
There is no such thing as a primitive value in Python, and there's no such thing as a reference. This explains it better than I can.
In python an integer, for example, is an object just like a list. There is no distinction between primitive/non-primitive as there is in some other languages. There is no copy-on-assignment in python, "assignment" just associates a reference to an object with a name, whether the object is an integer or a dictionary.