0% found this document useful (0 votes)
4 views1 page

Mutable and Immutable Objects

The document explains the difference between mutable and immutable objects in programming. Mutable objects, such as lists and dictionaries, can be modified at the same memory address, while immutable objects, like integers and strings, cannot be changed at the same address and do not support item assignment. It provides examples of both types of objects to illustrate the concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Mutable and Immutable Objects

The document explains the difference between mutable and immutable objects in programming. Mutable objects, such as lists and dictionaries, can be modified at the same memory address, while immutable objects, like integers and strings, cannot be changed at the same address and do not support item assignment. It provides examples of both types of objects to illustrate the concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

==============================================================

Mutable and Immutable Objects


==============================================================
--------------------
Mutable Object
--------------------
=>A Mutable Object is one, whose Contanet can be changed / modifiled / Updated at
Same Address.
=>Examples:
bytearray, list, set,dict
--------------------------------
Immutable Object
--------------------------------
=>An Immutable Object is one, which will satisfy the following Properties.

1. An immutable content can't be Changed at Same Address


( An immutable content can be changed and result placed at
NEW Address)
2. An Immutable Object does not Support Item Assignment.
----------------
Examples
----------------
int, float, bool,complex, str,
bytes,range,tuple,set,frozenset,NoneType.
-----------------------------------------------------------------------------------
-------------------------------------------------------------

You might also like