Mutable And Immutable Objects in Python.

  • That is id and type
  • The mutable objects
  • The immutable objects
  • Why is important this objects
  • Differently this objects
  • How arguments are passed to functions and that imply for mutable and immutable objects.
  • The Lists and Dictionaries is Mutable, that is to say that change their contents but not change their identity. This example we are created a list, and access to index zero with value of ‘1’ and assigned to value of ‘a’, this refer mutable, can be modified.
  • The Floats, Int, Strings and Tuples have no provision to change there assigned value for an index. The Tuple is a collection which ordered and unchangeable, it does not allow duplicate members, the Tuples is write round ( ), its separate for commas.
    This example the tuple is ordered and unchangeable that is to say cannot be modified, the assigns in the index zero for value ‘50’ is created but no is execute, return a error that indicate is immutable (cannot be modified)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store