What is Dictionary in python || Easy way to understand Dictionary

What is Dictionary in python 

What is Dictionary in python

A Dictionary in python is a key-value pair, similar to a List. But A dictionary consists of key-value pairs, Each key maps to its associate value. In other words, A Dictionary is the same as a list but with an extra parameter called keys, instead of using an index, we use keys in the dictionary. 

We can define a dictionary by enclosing a comma-separated list of key-value pairs in curly braces { }, A colon : separates each key from its associate value.

Example :-

dic = { < Key1 > :  < value1 >  ,  < key2 > : < value2 > , < key3 > : < value3 > }

dic= { ‘a’ : 10 , ‘b’ : 20 , ‘c’ : 50 , ‘d’ : 25 }

sports = { ‘cricket’ : ‘Sachin’ , ‘Hockey’ : ‘Major Dhyan chand’ , ‘Football’ : ‘Sunil Chhetri’ }

Important Links: Informatics Practices

What is Python Dictionary
How to create Python Dictionary
How to Traverse Dictionary in Python
Dictionary functions in Python with examples
What is Python List
Characteristics of Python List
How to create Python List
How to Traverse a List in Python
How to Manipulate List in Python
How to Modify multiple elements in Python List
Slicing in Python List
How to delete elements from List in Python

If you like my post please share it with your friends by simply clicking the below social media button, and Don’t forget to comment so we will update ourselves.

Share in a Single Click

Leave a Reply

Your email address will not be published. Required fields are marked *