0% found this document useful (0 votes)
41 views3 pages

Python Dictionary: Key-Value Basics

A dictionary in Python is a mutable collection of unique key-value pairs, where keys are immutable and values can be of any data type. It is defined using curly braces and allows for various operations such as creation, traversal, updating, and deletion of elements. The document outlines the basic concepts and functionalities of dictionaries in Python.

Uploaded by

rupendra98946
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views3 pages

Python Dictionary: Key-Value Basics

A dictionary in Python is a mutable collection of unique key-value pairs, where keys are immutable and values can be of any data type. It is defined using curly braces and allows for various operations such as creation, traversal, updating, and deletion of elements. The document outlines the basic concepts and functionalities of dictionaries in Python.

Uploaded by

rupendra98946
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

-

Dictionary in Python
A dictionary is a collection of key-value pairs where each key is unique, and values can be
of any data type. Dictionaries are mutable and are defined using {} (curly braces).

1. Concept of Key-Value Pairs

 A key acts as an identifier (e.g., a name, ID).


 A value is the associated data.
 Keys must be immutable (strings, numbers, or tuples), while values can be any data type.

2. Creating and Initializing a Dictionary:

3. Traversing a Dictionary:

4. Updating a Dictionary:
5. Deleting Elements from a Dictionary:

SUMMARY-1
SUMMARY-2:

You might also like