8.Dictionary in Python

Dictionary is an unordered collection of key-value pairs. It is generally used when we have huge amount of data.

dict={}

dict['one']= " this is one"

dict[2]=" this is two"

tinydict={"name": "john", 'code': 6789, 'dept: 'sales}

print(tinydict)

print(tinydict.keys())

print(tinydict.values())