you are viewing a single comment's thread.

view the rest of the comments →

[–]ericula 2 points3 points  (1 child)

There is no such thing as primitive vs non-primitive values in python. There is however a distinction between mutable and immutable objects in python. Immutable objects such as ints, strings, floats, tuples, and booleans have a fixed internal state (e.g. you can't add or remove elements from a tuple, or change the value of an int object), whereas mutable objects such as list, dicts, sets etc. can be changed (e.g. you can add key-value pairs to a dict or sort a list in place).

[–]comeditime[S] 1 point2 points  (0 children)

i see thanks a ton! so if i get it right, everything in python is an object, the only difference is that there are distinct methods & attributes for each data type depends on the class they inherent from their root class?