Important Notice:

Dictionary as a Mutable Data Type

Dictionary as a Mutable Data Type

3 views 1 min read
Dictionary as a Mutable Data Type :- Python में Dictionary एक Mutable Data Type है। इसका मतलब है कि Dictionary बनने के बाद हम उसके values को change, add या remove कर सकते हैं।

Example-
 
student = {"name": "Rahul", "age": 20}

student["age"] = 21

print(student)

Output:

{'name': 'Rahul', 'age': 21}

यहाँ 20 को बदलकर 21 कर दिया गया। इसलिए Dictionary को Mutable Data Type कहा जाता है।

In english-

Dictionary as a Mutable Data Type

In Python, Dictionary is a Mutable Data Type. This means that after a Dictionary is created, we can change, add, or remove its values.

Example
student = {"name": "Rahul", "age": 20}

student["age"] = 21

print(student)
 
Output:
{'name': 'Rahul', 'age': 21}

Here, 20 is changed to 21. Therefore, a Dictionary is called a Mutable Data Type.

Related Notes