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