Data types in Python

2. Types of Data types

2.2. Dictionary Data type

Dictionary is a built-in data type used to store collections of data in a key-value pair format. Every key is associated with a value and key is unique.

Dictionaries can be created by curly braces ‘{ } ‘ and key-value pairs are separated by colon ‘:’ . Key- value pair can be any other data types.

 

Example: employee = {‘name’:’Battu’, ‘salary’:40000, ‘dept’:’CSE’, ‘id’:22243 }

 

Print(“The type of empleyee”, type(employee))

 

Output:

The type of employee <class ‘dictionary’>